|
I create a item as CMFCToolBarComboBoxButton and add it to CMFCToolBar. Now, I can handle the message such as CBN_SELCHANGE. But how to handle the edit message of CMFCToolBarComboBoxButton.
I tried with EN_CHANGE and CBN_EDITCHANGE, but the breakpoint in these handler did not work.
Please tell me how I should do?
Thanks!
|
|
|
|
|
Hi,
How to check whether the dll can be loaded in c++?
Thanks,
|
|
|
|
|
|
Yeah,I have loaded the dll and its returning 0x11000000 value in HINSTANCE But while getting the address of that function,its returning value 0x00000000. Whats the reason? If we open a dll in notepad, it should contain the function names right? but this is dll is not showing any fn names in notepad. Please tell me why GetProcAdress is returning NULL value?
Thanks,
|
|
|
|
|
Maybe a function name mangling issue. Why don't you use the Dependecy Walker tool [^] to see function names?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Yes.I have used Dependency walker. But its showing only 4 functions DllCanUnLoadNow,DllGetClassObject,DllRegisterServer,DllUnregisterServer.
But I can use the functions in .net. In c++ only, its not working.
|
|
|
|
|
Karthika85 wrote: only 4 functions DllCanUnLoadNow,DllGetClassObject,DllRegisterServer,DllUnregisterServer.
That's because it is a COM server and you have to use the COM way (e.g. via CoCreateInstance [^] function) to access it's functionality.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Have you correctly exported your function names with __declspec(dllexport) ?
It's time for a new signature.
|
|
|
|
|
No.This dll is given by a vendor.This is not our dll.
|
|
|
|
|
Karthika85 wrote: This dll is given by a vendor.
Then they are the people you need to talk to, as they should have both the source code and the instructions on how to use the functions.
It's time for a new signature.
|
|
|
|
|
|
Put this before class and function names that you want to export from the dll.
extern "C"
This will prevent the C++ way of mangling the names. Theres nothing wrong in mangling but if you export a function like
int Sum(int, int) C++ will NOT reduce that to _Sum, like C and like you might expect. That means when you import that into your program, you can't simply search for "Sum" but have to follow C++ name mangling rules and search for THAT name.
...byte till it megahertz...
|
|
|
|
|
For example, a game only supports connecting in one lan. How to make it connectable via Internet?
VPN?
|
|
|
|
|
Your question isn't really a C/C++/MFC related question, you should try a more suitable message board. However, VPN could work, but as far as i know some games use broadcast packets to find their servers on the lan but broadcast packets aren't submitted through internet via VPN (i might be wrong of course). In this case, you might try somesort of tunneling, like an SSH tunnel or somesuch, maybe that could work. Come to think of it, trying the tunneling might even be a better choice at the first place.
By the way, just so you know, it might be illegal to do what you wish if the makers of the game charge players extra for internet gameplay and you are trying to avoid paying by making a LAN game go thorough the net.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> "It doesn't work, fix it" does not qualify as a bug report. <
> Amazing what new features none of the programmers working on the project ever heard of you can learn about when reading what the marketing guys wrote about it. <
|
|
|
|
|
I am highly used to C than C++, but now I'm trying to understand C++ as well. I have fstream object which I used to create a file for output.
What I want is that if there is any file write error, the file that was created should be removed from the disk. What is the name of the method that I should invoke with the fstream object to remove the file from the disk, as it is done in C using remove() to accomplish such a goal? Please help.
|
|
|
|
|
|
I think DeleteFile is Windows specific, so I wouldn't want that one. I will use remove() rather. But does it mean there is no method in C++ to be used for such a goal?
|
|
|
|
|
Dan_K wrote: But does it mean there is no method in C++ to be used for such a goal?
Not that I am aware of, as these functions are beyond the scope of the C++ language. If you include <cstdio> [^] you can then use it in the form std::remove() .
It's time for a new signature.
|
|
|
|
|
as you know, C++ is a super set of C, and you are always free to use C functions wherever in C++ code
|
|
|
|
|
I want to capture ip packet sent by an application, and modify the packet then resent it.
The destination host should receive only the modified packet.
I found a solution that using hooking, but I don't know whether it will work with packet that is sent asynchronously.
A filter driver will work, but I'm not very familiar with that now.
Any other solution?
Thanks.
|
|
|
|
|
|
Hi all,
i m creating property sheet in my application.
i want to set font of all property pages and property sheet so i m using this article to set font of property sheet.
http://support.microsoft.com/kb/142170[^]
here is a problem help button not display in the property sheet.
i want to use help button on property sheet.
so please help me for this.
thanks in advance.
|
|
|
|
|
I have one MFC project which listents on some COM port and fires events when something happens.
Now I want to create a dll for it so that I can reuse it in .NET projects with C#.
First Question : Is it right to make a dll of it, if not then what are other ways?
Second Question : If I go for making dll then how my dll will fire events or send information to C# application, any example ?
I am also looking into this[^]. Am I on right track?
|
|
|
|
|
The answer, as usual, depends. What you propose would be one solution to the problem. However, you may also like to consider the .NET support for Serial.IO[^], which could be a better solution for a C# program.
It's time for a new signature.
|
|
|
|
|
Well Richard and Luc!
This is the restriction, I have to go with that code because our company does not want to re-write the code in .NET because of Time Limitation, so tell me how to access classes or functions of MFC dll inside C#. There are several threads and articles so I am confused how to go ahead.
Thanks,
Rahul Kulshreshtha
|
|
|
|