Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 16th, 2012  |  syntax: None  |  size: 0.57 KB  |  hits: 20  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. How to specify a function that takes a void* in C   OCX module?
  2. afx_msg void Test(void const* pSrc);
  3.        
  4. BEGIN_DISPATCH_MAP(COcxTestCtrl, COleControl)
  5.     DISP_FUNCTION_ID(COcxTestCtrl, "Test", 1, Test, VT_EMPTY, VTS_PI1 /*??*/)
  6. END_DISPATCH_MAP()
  7.        
  8. dispinterface _DOcxTest {
  9.     properties:
  10.     methods:     [id(1)] void Test(void const* pSrc);
  11. };
  12.        
  13. Sub Test(pSrc As Any)
  14. Member of OcxTestLib.OcxTest
  15.        
  16. Private Sub TestButton_Click()
  17.     Dim text() As Byte
  18.     Dim buflen As Long
  19.     buflen = 2 ^ 16
  20.     text = String(buflen, "Z")
  21.     OcxTest1.Test (text(0))
  22. End Sub