|
Hi,
Is it possible to call explicitly a class from a DLL (not a simple C function but a C++ class)?
I suppose we must use ::Loadlibrary("my_dll_path_to_call") and GetProcAddress(hInstance, "class_name_from_dll") ... like the call of a simple C function!
Thanks for your suggestion.
Hello World!!!
from Raphaël
|
|
|
|
|
Even if this was possible, what would you do with the result of GetProcAddress(hInstance, "class_name_from_dll") ? Think it over, a class is not an entity per se in a program, only their instance objects (The situation differs in Java and C#, where classes are program entities).
GetProcAddress will give you pointers to functions, with a little work it is possible to make it return pointers to the methods of a given class: if this is what's in your mind, you might consider exporting classes from a DLL (see the docs), but this is a whole different beast than you're asking for.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Yeap... It's true... I had forgotten this... Thanks.
(I think that I will sleep early today )
Hello World!!!
from Raphaël
|
|
|
|
|
I've written an console app. Is there a way to make the window from not popping up. I want to hide the window because there is nothing for the user to see.
How can I get a handle that is useful for showwindow to use to hide the window?
Thanks
Tom Wright
tawright915@yahoo.com
|
|
|
|
|
Probably the easiest way to accomplish this is to write your program as a Win32 app (with WinMain ) and not do any UI at all. If you still need argc and argv , resort to the equivalent global variables __argc and __argv .
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
I'm using the ping class listed in network/internet section of CP. When I compile my app in debug mode it works great. When I compile it in release mode I get the following error:
C:\Program Files\Microsoft Visual Studio\VC98\MFC\INCLUDE\afxcmn2.inl(293) : error C2084: function '__thiscall CIPAddressCtrl::CIPAddressCtrl(void)' already has a body
Both have the same settings. I'm not sure what this error means, can someone give some insight to this.
What's even stranger is that when I compile on my laptop it compiles fine in both debug and release. Could I have a header file that is out of date?
Thanks
Tom Wright
tawright915@yahoo.com
|
|
|
|
|
This code would cause that error:
in .h file:
class A
{
void function1(){};
};
in .cpp file:
void function1()
{
}
If you would remove the {} in the .h file it would compile!
See if CIPAddressCtrl looks like that.
Rickard Andersson@Suza Computing
C# and C++ programmer from SWEDEN!
UIN: 50302279
E-Mail: nikado@pc.nu
Speciality: I love C#, ASP.NET and C++!
|
|
|
|
|
hi friends,
My question is related to VC.NET. I am working on VC++ on my application since last 1 yr. Now we are migrating to VC.NET. In the process, i am getting 100 errors related to T2A macro.
the macro converts to W2A under unicode build.
the error is "error C2664: 'T2A' : cannot convert parameter 1 from 'CString' to 'LPTSTR'" . the same line of code was working well/ works well in VC 6 env.
the code is
xmlSetProp(relListNode, SAFE_CAST("rid"), SAFE_CAST (T2A(relID)));
Please ignore the XML related stuff. The area of problem is
T2A(CString) .
If anyone knows any solution, please help.
Thnaks and regards.
Vikram
|
|
|
|
|
There is no conversion for CString to a non-const string.
Reading the help, it looks like you need to use the T2CA macro.
|
|
|
|
|
I have created my own files going along with my application, let's say they are .rage files. How do I do to get them programatically registered, so that if I click on myfile.rage, for instance, it opens my application and load my file ?
Has this to do with the shell or with the registry or both ?
~RaGE();
|
|
|
|
|
Yes. You can create a key .rage\shell\open\command in your HKCR key. At command add something like: "yourapplication.exe %1"
Exontrol Software Inc.
http://www.exontrol.com
|
|
|
|
|
Thanks, but this is not working (i have to run it under NT). Restarting does not help...
~RaGE();
|
|
|
|
|
Hi,
We need to detect with our App under Windows XP whether the application has a manifest file associated with it.
Does anyone know of a method of checking to see if the instance of our app has the manifest file associated with it, we need this to switch on XP style buttons in the UI toolkit we have bought in.
Thanx
Dave
|
|
|
|
|
I have a game that allows you to display the frame rate in the upper right corner of the screen. I want to intercept the data being shown there so I can determine the minimum and maximum frame rate attained (it changes wildly depending on the current conditions of the game).
I tried using Spy++ to see if I might be able to get a window handle (wehile the game was running), but no joy.
Does anyone have an idea of how I might go about intercepting this data?
Oh yeah, it must work no matter which 3d engine the game is using - OpenGL or DirectX, and it would be nice if it would also work in both full-screen AND windowed mode.
Many thanks in advance.
------- signature starts
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
Please review the Legal Disclaimer in my bio.
------- signature ends
|
|
|
|
|
At one point I hide the Cdialogs.....pDlg->SHowWIndow(SW_HIDE);
Later when the user definitely decides he is going through with a certain action, I want to destroy them (modeless) pDlg->DestroyWindow();
Do I have to do a SHowWIndow(SW_SHOW) right before I destroy, or can I go ahead and destroy the hidden CDlg?
Thanks
Appreciate your help,
ns
|
|
|
|
|
No need to show the window. Just point your AK47 at it and KABOOM.
/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
Its FRidayyyyyyyy! Whatcha doing today? Is it time to go home yet............?
Appreciate your help,
ns
|
|
|
|
|
Heh. Worked from home yesterday, and hacked late into the night! Decided to have cereal at 2:00am and realized I was out of milk.
But on the bright side, I'm having fun with Xerces and Doxygen. Now I have to fight fresh snow during my 1.5 hour drive into Cambridge. Wheeeeee!
Have a great weekend!
/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
yup - doxygens cool...I havent fully explored it...drive safely....70 Deg F here....
Appreciate your help,
ns
|
|
|
|
|
Hey, does anyone know how to close a certain program that is running. I am making a toolbar to contol Kazaa and I found out how to open Kazaa but now I need to know how I can close it. Is there a message I send?? Thanks for any help.
|
|
|
|
|
Try using CWnd::FindWindow() to find its main window, then SendMessage() it a WM_CLOSE .
/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
|
Nice! Thanks for the link!
/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
Wow, thanks for the quick posts guys
|
|
|
|
|
Hello
It's a standard mfc control ? See a smaple a http://www.bacad.ch/listing.jpg
How can i implement it ?
thanks you
|
|
|
|