Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <windows.h>
- #include <stdlib.h>
- #include <tchar.h>
- typedef void(__stdcall * CallbackFunction)();
- DWORD __stdcall ThreadFunc(CallbackFunction Callback) {
- Callback();
- return 0;
- }
- __declspec(dllexport) void __stdcall message(CallbackFunction Callback) {
- // Array to store thread handles
- HANDLE Array_Of_Thread_Handles[1];
- Array_Of_Thread_Handles[0] = CreateThread(NULL, 0, ThreadFunc, Callback, 0, NULL);
- }
- Private Sub Form_Load()
- Call message(AddressOf Callback)
- End Sub
- Public Declare Sub message Lib "MonitoringDirectoryDLL.dll" Alias "_message@4" (ByVal Callback As Long)
- Public Sub Callback()
- On Error Resume Next
- Forms("MyForm").txtTest="test" 'this line executed well and the string "test" appears ok in the form.
- Forms("MyForm").Filter="" 'in this line Access crashes out
- Forms("MyForm").FilterOn=True
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement