|
Intresting! volatile modifier does not help?
I noticed that thread accesses quit variable only after terminating of OnClose() method where quit variable modified, so what is the purpose of Events after this incident?
9ine
|
|
|
|
|
hi
Please help me.
I have implemented class in DLL(in vc++). now i want to access
that class in vb. how can i do this.
Is it possible to create instance of class in vb.
if anybody knows please tell me about this.
|
|
|
|
|
rajesh_kapure wrote:
I have implemented class in DLL(in vc++)
You mean a COM Dll. Right?
You can add a reference to your COM Dll in VB through Project->References. After that you can use the COM Dll's methods.
Steve Mayfield: "Coding in VB is like riding a tricycle...once you figured out how to peddle, its really hard to fall off."
My Articles
|
|
|
|
|
Thanks Aamir
i already done that thing.
but whenever i add a refference of COM Dll it gives message "can't add
reference to the specified file"
can you give me step or source code for how to create COM DLL in vc++.
so that i will better understand.
Rajesh
|
|
|
|
|
|
No, Can you tell me step by step how to create COM DLL.
or send me source code for that.
Rajesh
|
|
|
|
|
Hello.
I can't solve one problem.
I need on WM_KEYDOWN set focus on Edit and to add to Edit symbol,that was pressed.Also I need to save information about CapsLock and Shift.
Can anyone help me?
|
|
|
|
|
Hi,
Is there any alogrithm for conversion between UTF8 and UTF16. Need help reg this. Urgent.
Thanks
Cool Ju
|
|
|
|
|
|
Hi
I have the problem while calling webservice created in ASP.net through vc++.
Any kind of help is appreciated.
cheers
hi
|
|
|
|
|
|
|
I am trying to write a DLL that will allow my visual basic application to receive Window messages. Problem is, when my DLL trys to register the hook, it crashes. Here is the code to my DLL:
////////// Header Files //////////
#include <windows.h>
#include <string.h>
#include "dllutil.h"
#include <winuser.h>
#pragma data_seg ("GlobalData")
long CallBackFunctionPtr =0;
HANDLE DLLHandle =0;
HHOOK HandleToHook =0;
long VBFunctionPtrAddress =0;
#pragma data_seg()
#pragma comment(linker, "/section:GlobalData,RWS")
//end of Global Memory setup
//This is my Generic Hook Function
LRESULT CALLBACK WindowsMessageMonitorHook(int nCode, WPARAM wParam,LPARAM lParam)
{
tagCWPSTRUCT *CPWStructPtr;
//Initlize the pointer not sure if this is correct.
CPWStructPtr = (tagCWPSTRUCT *)lParam;
//this is how call vb back
typedef void (__stdcall *FNPTR)(long x);
FNPTR FunctionCall;
if (nCode == HC_ACTION)
{
//Send Message Back to VB routine
FunctionCall = (FNPTR)VBFunctionPtrAddress;
FunctionCall((long) CPWStructPtr->message);
}
return CallNextHookEx(HandleToHook,nCode,wParam,lParam);
}
HHOOK StartCallBack()
{
//debug message - I can see this message displayed OK
::MessageBox(NULL,"Set Windows Hook","C++ DLL",0);
//but when I single step on this next line, it crashes
HandleToHook = SetWindowsHookEx(WH_CALLWNDPROCRET,
WindowsMessageMonitorHook,
(HINSTANCE)DLLHandle, 0);
//I never see this message.
//Even if I type case WindowsMessageMonitorHook as
//HOOKPROC I get the same resutls.
//I never see this message.
::MessageBox(NULL,"Hooks Have been set","C++ DLL",0);
return HandleToHook;
}
// Receives the address of a Visual Basic function and calls
// it.
extern "C" HHOOK __declspec(dllexport) __stdcall CALLBACK
CallBackExample(long Addr1)
{
HHOOK HookResults;
//Store in global variable
VBFunctionPtrAddress = Addr1;
//Startup MessageMonitorHook
HookResults = StartCallBack();
if (HookResults == 0)
{
::MessageBox(NULL,"Start Hook Results =
0","C++ DLL",0);
}
else
{
::MessageBox(NULL,"Start Hook Results not
zero.","C++ DLL",0);
}
return HookResults;
}
extern "C" BOOL __declspec(dllexport) __stdcall CALLBACK
StopWindowMonitorHook()
{
BOOL Results;
Results = UnhookWindowsHookEx(HandleToHook);
return Results;
}
BOOL APIENTRY DllMain( HANDLE hModule,
DWORD ul_reason_for_call,
LPVOID lpReserved
)
{
//save dll handle in global memory
DLLHandle = hModule;
switch(ul_reason_for_call)
{
case DLL_PROCESS_ATTACH:
break;
case DLL_PROCESS_DETACH:
break;
}
return TRUE;
}
Any Idea why it crashes?
|
|
|
|
|
A little tip first: Call CallNextHookEx(HandleToHook,nCode,wParam,lParam); at the beginning of the hook function, else it could cause kinda deadlock for every application running.
Don't try it, just do it!
|
|
|
|
|
I tried it, no help. It never makes it to the HOOK call back function. So it dies on the SetWindowsHookEx function.
It dies right here:
HandleToHook = SetWindowsHookEx(WH_CALLWNDPROCRET,
WindowsMessageMonitorHook,(HINSTANCE)DLLHandle, 0);
|
|
|
|
|
Is anybody knows how to rebuild MFC files under the folder "Microsoft Visual Studio\VC98\MFC\SRC", I know roughly there are two processes involved, one is to add the "Microsoft Visual Studio\VC98\Lib" to the "path" Environment variable, the other is to nmake certain makefile!But haven't seceed yet!
|
|
|
|
|
I don't know that you can, and I'm sure that you shouldn't. If you want to replace MFC, you should do so explicitly. Changing MFC, and calling it MFC42.dll is a DISASTEROUS idea.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
You can: There is a readme.txt in the atlmfc\src path, read it, there are the instructions how to re-compile MFC and ATL.
Don't try it, just do it!
|
|
|
|
|
I have a handle to a button from an external application.
I want to fire that button on that app.
what API call would I use?
Maybe send message? Im not sure?
The app i'm calling is an MFC app and using spy++ the says its "Button"
and I already found the button and window using FindWind and FindWindowEx.
thanks
nick
I'm not an expert yet, but I play one at work. Yeah and here too.
|
|
|
|
|
forget it. I figured it out.
I'm not an expert yet, but I play one at work. Yeah and here too.
|
|
|
|
|
I wanted to use source file from the article "A Rich Edit Control That Displays Bitmaps and Other OLE Objects"
By Mike O'Neill
but the zip file is dameged or currupted. Is there anyone who has correct file?. If yes then please send me that file on
aqueelmirza@hotmail.com or aqueelmirza@yahoo.com
Thank you
Aqueel A. Mirza
We Believe in Excellence
|
|
|
|
|
Ask the author.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
I know that in Windows95, we use the function _outp and _inp to access the I/O port. But they can't be used in Windows2000. What can I do? Should I have to use some software to develop a driver?
|
|
|
|
|
You must develop a kernel mode driver or may be using the already exist driver such as WinIO.
Best regards,
A. Riazi
|
|
|
|
|
You can use CreateFile & WriteFile [^]
to access to serial port.
Marc Soleda
... she said you are the perfect stranger she said baby let's keep it like this... Tunnel of Love, Dire Straits.
|
|
|
|