|
Thanks a lot
|
|
|
|
|
hi,
How can we use the thumbnail view in a list ctrl?
bye
|
|
|
|
|
|
Hello I am only a beginner. I like to ask if how to use visual c++? What are their variables?
Dark Angel
|
|
|
|
|
What do you mean with variables??
Hardy.
|
|
|
|
|
What to use in visual c++? I mean their language and code.
Dark Angel
|
|
|
|
|
Language -- for what?? Programming language - c++, Language for user interface ?? Whatever you like.
Are you a programmer?
|
|
|
|
|
Are you familiar with C or C++ programming?? Do you have any programming experience. If not, then I suggest you to learn C++ language first, before moving to Visual C++.
ARSALAN MALIK
|
|
|
|
|
Hi !
I'm calling a function of a api to which I have to give a pointer to a callback function. Here is the typedef :
typedef int (*proc_restore_progress_callback)(restore_progress_data*)
The problem is that I want, as the callback method, to pass a method of my own class. I tried something like this :
api_set_restore_progress_callback(JSPartLoader::setRestoreProgress);*)
Here is the signature of the 'setRestoreProgress' method :
int JSPartLoader::setRestoreProgress(restore_progress_data* pProgressData);*)
But I get a compiler error :
error C2664: 'set_restore_progress_callback' : impossible to convert the parameter 1 from 'int (restore_progress_data *)' to 'proc_restore_progress_callback'
Is it possible to give a class' method as the callback function or do I have to have a global function which will be the callback function ?
Thanks for your help !
Jerome
|
|
|
|
|
This problem is related to the class abstracty concept. As you specify that ClassA::MethodA is a callback function for some other function, then how, at run-time, can then code determine the correct instance of class ?
The problem is most often faced in wrapping Win32 API functions inside C++ classes. GameDev.Net has an excellent article about this, here[^].
If you wish to use a class method as callback's target, the method must be declared static, or you need to have a static router function that can flawlessly determine the instance to which the method should be routed.
Also, there is a Code Project article written by Nitzan Shaked here[^] that provides yet another approach to the problem.
Hope this helps..
-Antti Keskinen
----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
|
|
|
|
|
Many thanks for your help Antti ! I'll have a look at the different methods you suggest !
Thanks,
Jerome
|
|
|
|
|
Is there anybody who worked on memory leaks in MFC,
whenever a model dialog is open there is an increase of 4 k bytes of memory and when it is closed it is not released.
And also whenever a spin control is used for the first time there is an increase of memory which is not reduced when the dialog is closed.
Why it is like this? where is the leak?
vidya
|
|
|
|
|
|
Yes there is a leakage, when my application is started
it is having only mainframe that time the memory in task manager is 3500k
now i opened one dialog from the menu bar...and the memory increased to 3788k
when i closed that dialog the memory is not reduced back to 3500k
why it is like this? Is there any virtual function i need to call for this dialog?
In that dialog i am not allocating anything still when the dialog is initialized the memory is increased by not decreased on closing of that dialog.
vidya
|
|
|
|
|
The symptoms you have described do not mean it is a leak.
What happens if you repeatedly open and close the dialog? Does the memory keep increasing each time or does it stay at 3788k? I expect it will stay at 3788k or whatever indicating that it is not leaking.
Mike
|
|
|
|
|
visual studio .net normally shows up memory leaks after the program exited. try to execute the debug version of your software via vs .net.
Don't try it, just do it!
|
|
|
|
|
Did you actually read the article that Jon Hulatt was referring to? It explains why your memory used by your app doesn't decrease...
Multiply it by infinity and take it beyond eternity and you'll still have no idea about what I'm talking about.
|
|
|
|
|
Dumping objects ->
{462} normal block at 0x00628CE0, 36 bytes long.
Data: <192.168.100.83 S> 31 39 32 2E 31 36 38 2E 31 30 30 2E 38 33 00 53
strcore.cpp(118) : {456} normal block at 0x00628D30, 23 bytes long.
Data: < Prod> 01 00 00 00 09 00 00 00 0A 00 00 00 50 72 6F 64
strcore.cpp(118) : {455} normal block at 0x00628D80, 30 bytes long.
Data: < name> 01 00 00 00 10 00 00 00 11 00 00 00 6E 61 6D 65
strcore.cpp(118) : {454} normal block at 0x00628DD0, 29 bytes long.
strcore.cpp(118) : {331} Memory leaked!
I am getting like this when i use DumpAllObjectsSince(); while checking for memory leakage.
Where is the leakage?
vidya
|
|
|
|
|
Hello,
Maybe you are doing some things with a CString that you shouldn't. For exemple when you manipulate the CString contents directly without calling CString.ReleaseBuffer() will result in behaviour you don't want...
Multiply it by infinity and take it beyond eternity and you'll still have no idea about what I'm talking about.
|
|
|
|
|
I read this article. Thanks.
Can you suggest some other tools(evaluation copy) for checking memory leakage in a souce code.
I think we wont get an evaluation copy of Bound Checker.
vidya
|
|
|
|
|
I have a MDI application when it is created the memory occupied for that application in task manager is around 2000K i open some document in that MDI application, the usage of memory grows up. Now i minimize the main frame window and i notice in task manager the memory is decreased to around 1000K.
I think the resouces which were not used are released when the mainframe is minimized.
Please let me know if anybody knows....
Which function is called when the mainframe is minimized?
How the resources are released when it is minimized?
vidya
|
|
|
|
|
Thanks.
I got the solution for this
go through this link
http://support.microsoft.com/default.aspx?scid=http://support.microsoft.com:80/support/kb/articles/Q293/2/15.asp&NoWebContent=1#appliesto
vidya
|
|
|
|
|
I need to design a dialog based application in vcpp through which i need to send and receive data through the com port.
Still now,i've completed the part through which i can send and receive data using a buffer.
i've not included the com port module so far.
1) In my menu options i've included all the ports, but the ports which r presently connected to the system should be enabled.
2) I've to configure the port, even if it is connected or not.
3)By choosing that particular port, i need to connect and send and receive data through it.
mithila
|
|
|
|
|
Look at
http://www.codeproject.com/system/serial.asp ( CSerial )
or at the wfc, there is a serial class.
or
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnfiles/html/msdn_serial.asp
Good Luck,
Hardy.
|
|
|
|
|
Hi,
I'm using menu in my module.
The ports which r present in the system should be enabled in the menu.
How is it possible?
mithila
mithila
|
|
|
|