|
hi
how do i open a new property sheet on click of a page on old property sheet.
|
|
|
|
|
Just as you create the first one. Is there some problem that you are facing, can you explain something more on this scenario?
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
How can I compare two strings that contain a version?
For Instance:
CString string1 = 10.2.33.4
CString string2 = 10.4.22
so in this case - string2 is higher than string1.
Is there a windows function that I can use (or something of the sort), or do I have for each string to break up the string at each '.' insert each part into an integer and compare each part of the two strings separately?
Thanks,
|
|
|
|
|
I'm not familiar with any such Window-API function ... You'll probably have to break the strings up just like you said ...
|
|
|
|
|
Hello,
if you can obtain something like 10.2.33.4 and 10.4.22.0(actually same number of characters, 00.00.00.00) then you can strip the dots out and compare the numbers directly. if the number is higher than it is more recent.
Bekir.
|
|
|
|
|
SWDevil wrote: CString string1 = 10.2.33.4
CString string2 = 10.4.22
Parse the array of characters and
Make string =10.02.33.04 & string2 = 10.04.22.00
and then compare the two.
Hope it helps
Spread wat u Know!
|
|
|
|
|
Hi all.
If you can tell me some class in C++ (NOT MFC) thet can read data file.
(Example: .xls; .dbf; . . . . . )
|
|
|
|
|
Look at ADO. Using ADO I think you will be able to read .xls , .txt , .mdb ,..... files.
|
|
|
|
|
hi
i need to write an application using VS2005 that runs both on desktop and on wince device. can anyone help me out with this? i am setting the project for two configurations but am getting a linking error when compiling for WinCE configuration.
thanks
|
|
|
|
|
WinCE has numerous limitations. With WinCe, you do not have all the APIs that you have for Windows. What is the linker error?
|
|
|
|
|
Hi All
How can i get the Address of an Member function in Regular DLL using
GetProcAddress();
I would be fine if i get an article for using an member function of an class in an dll.
And what is the purpose of .def file and how to create it.
VIBIN
"Fool's run away,where angle's fear to tread"
|
|
|
|
|
See Here
The .def file is a Module-definition (.def) file that provides the linker information no exports, attributes, and other information about the program to be linked. A .def file is most useful when building a DLL.(.def) file is useful when you are not using the __declspec(dllexport) keyword to export the functions from the DLL.
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
He wants to get the address of a member function. This link isn't much help in this regard as it doesn't address issues such a name mangling which are required to get it to work.
Steve
|
|
|
|
|
Yeah Steve. Thanks for ur words. I do realize it.
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
Ya that link shwos how to access global function.
I would like to access the member function's addtess from an dll.
VIBIN
"Fool's run away,where angle's fear to tread"
|
|
|
|
|
HMODULE hMod = LoadLibrary(_T("C:\\YourDLL.dll"));<br />
<br />
if (hMod > (HINSTANCE)HINSTANCE_ERROR)<br />
{<br />
FARPROC lpDllEntryPoint = GetProcAddress(hMod, "YourFunction");<br />
if (lpDllEntryPoint != NULL)<br />
{<br />
(*lpDllEntryPoint)();<br />
}<br />
FreeLibrary(hMod);<br />
}
Regards,
Paresh,
|
|
|
|
|
He wants to call member functions. Because of name mangling getting the name of the function is not trivial. For example, on MSVC6 the mangled name of the function void CMyClass::MyFunction() is “?MyFunction@CMyClass@@QAEXXZ”. Name mangling is also compiler specific.
Steve
|
|
|
|
|
Thanks.
If we look at the MSDN help for GetProcAddress it says "The GetProcAddress function retrieves the address of an exported function or variable from the specified dynamic-link library (DLL)." Hence, we cannot use GetProcAddress in this scenario.
Regards,
Paresh.
|
|
|
|
|
It is possible, just a little messy.
Steve
|
|
|
|
|
Please let me know if you find a way.
Regards,
Paresh.
|
|
|
|
|
First you have to find the mangled name of the function you want to import. Probably the easiest way to do this is generate a linker error. For example:
class CMyClass
{
public:
void MyFunction();
};
void main()
{
CMyClass mc;
mc.MyFunction();
}
Since the function CMyClass::MyFunction is not defined (it is declared) the linker produces the following error message:
“error LNK2001: unresolved external symbol "public: void __thiscall CMyClass::MyFunction(void)" (?MyFunction@CMyClass@@QAEXXZ)”
I have underlined the mangled name.
Use this name when calling GetProcAddress
Assume the following typedef:
typedef void (CMyClass::*PMyFunction)();
Then our code would look like this:
FARPROC pRaw = GetProcAddress(hModule, "?MyFunction@CMyClass@@QAEXXZ");
PMyFunction pFun;
*(FARPROC*)&pFun = p;
CMyClass mc;
(mc.*pFun)();
All in all it's a bad design and should not be contemplated; the whole think stinks of hack. Use COM instead.
Steve
|
|
|
|
|
|
|
Or can put the following code in DLL to create object for the class MyClass in Client Application
extern "C" __declspec(dllexport) MyClass* CreateObjectofMyClass()
{
return new MyClass();
}
extern "C" __declspec(dllexport) MyClass* DeleteObjectofMyClass(MyClass *a)
{
delete a;
}
VIBIN
"Fool's run away,where angle's fear to tread"
|
|
|
|
|
This will not help as it stands. The DLL contains the class’s functions and the EXE (what loads the DLL and wants to call into it) will contain the class definition only (no function definitions). You still need the addresses of the functions of the class in the DLL; you’ve only got the address of the class itself. You can get around this by using virtual functions however.
Steve
|
|
|
|