Advertisement
Guest User

Untitled

a guest
Jun 18th, 2019
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. #include <windows.h>
  2. #include <stdlib.h>
  3. #include <tchar.h>
  4.  
  5. typedef void(__stdcall * CallbackFunction)();
  6.  
  7. DWORD __stdcall ThreadFunc(CallbackFunction Callback) {
  8.  
  9. Callback();
  10. return 0;
  11. }
  12.  
  13.  
  14. __declspec(dllexport) void __stdcall message(CallbackFunction Callback) {
  15. // Array to store thread handles
  16. HANDLE Array_Of_Thread_Handles[1];
  17. Array_Of_Thread_Handles[0] = CreateThread(NULL, 0, ThreadFunc, Callback, 0, NULL);
  18. }
  19.  
  20. Private Sub Form_Load()
  21. Call message(AddressOf Callback)
  22. End Sub
  23.  
  24. Public Declare Sub message Lib "MonitoringDirectoryDLL.dll" Alias "_message@4" (ByVal Callback As Long)
  25.  
  26. Public Sub Callback()
  27. On Error Resume Next
  28. Forms("MyForm").txtTest="test" 'this line executed well and the string "test" appears ok in the form.
  29. Forms("MyForm").Filter="" 'in this line Access crashes out
  30. Forms("MyForm").FilterOn=True
  31. End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement