|
|
Dear All,
I am playing with Registry Entries. here the code .,
while(RegEnumValue(hRoot1,Cnt,ValName,&nCnt,NULL,NULL,Buffer,&BufferSize)==ERROR_SUCCESS){
if(MemberVariable==ValName){
AfxMessageBox(_T("Matching Success"));
RegSetValueEx(hRoot1,ValName,0,REG_SZ,(BYTE*)&MemberValue,sizeof(MemberValue));
}
}
Here the "RegEnum" function is successed only for two times. But in my registry (hRoot1) Key is having more than seven value names. Here i am doing while loop iteration for all value names. But its doing with first two value names.
Can one help me on this ?
|
|
|
|
|
Sakthiu wrote: if(MemberVariable==ValName){
What are you hoping to accomplish with this? Unless MemberVariable is a CString or std::string object, what you have will not work.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
I think so ., that 'RegEnumKey' function is not properly working.(while doing more iterations).
MemberVarible is a CString.
ValName is a char[256];
now try it ...
|
|
|
|
|
Why are you not incrementing Cnt ? It should be 0 for the first call to RegEnumValue() and then be incremented for each successive call.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
CMyClass::CMyClass()
{
m_thread=(HANDLE)_beginthreadex(0,0,&MyClass::MyFunct,0,0,0);//error C2664: '_beginthreadex' : cannot convert parameter 3 from 'unsigned int (__stdcall CMyClass::* )(void *)' to 'unsigned int (__stdcall *)(void *)'
}
CMyClass::~CMyClass(void)
{
CloseHandle(m_thread);
}
unsigned __stdcall CMyClass::MyFunct(void* param)
{
return 0;
}
|
|
|
|
|
It has nothing to do with the fact that you start it in your constructor. The problem is that the 3rd argument you pass to beginthreadex is invalid: the function expects to have a pointer to a global function and you pass a pointer to a member function. The difference is that they don't have the same prototype: the member function has an implicit parameter: the this parameter (that allows the function to know to which instance of the class it belongs to).
To solve the problem, you can declare the function as static (in that case, the this parameter is not passed). But of course, you won't be able to access members of the class which are non-static (because the function is global to all instances and thus doesn't belong to a specific instance).
Another solution is to pass the pointer to a global function and pass the pointer to the instance of your class as the parameter (this). In the function, you'll then need to cast it to your class:
unsigned __stdcall MyGlobalFunct(void* param)
{
CMyClass* pClass = (CMyClass*)param;
pClass->MyMemFunction();
return 0;
}
|
|
|
|
|
|
What happens if you run this code
<br />
unsigned __stdcall MyFunct(void* param);<br />
...<br />
...<br />
m_thread=(HANDLE)_beginthreadex(0,0,&MyFunct,0,0,0);<br />
<br />
unsigned __stdcall MyFunct(void* param)<br />
{<br />
return 0;<br />
} <br />
|
|
|
|
|
hi,
I want to write large amount of binary data to the database.I wanted to write the same data,which i serialize in serialization into the database.Instead of saving it as disk file ,i want to write the file into database.One of my friend has said we can do it using BLOB.What is BLOB ? i don`t know anything about it.There is any good article about it using ADO.?I am using ADO.
thank`s in before
James.
|
|
|
|
|
RockyJames wrote: What is BLOB ?
See here.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Hi,
Could u tell me the formula of point of intersection?
Here I have two straight lines
First straight line co-ordinate (x,y) & (x1,y1)
Second st. line co-ordinate (x2,y2) & (x3,y3).
Now I have all these co-ordinates with me,so please suggest me the point of intersection formula based on above input.
Thanks in Advance
Ram
|
|
|
|
|
http://local.wasp.uwa.edu.au/~pbourke/geometry/lineline2d/
google
|
|
|
|
|
Sir
Can anyone help me in knowing abot MapFiles
What is a Map file? Why we have to use a Map File?
thank you
Fly Like An Eagle With MIGHTY POWER.
|
|
|
|
|
A map file is a file that contains all of the address information (and other stuff) about your code, either in the form of an offset from a starting location, or the actual runtime value. I use map files to get the addresses of exported variables in my VxWorks embedded code.
|
|
|
|
|
CodeVarma wrote: Can anyone help me in knowing abot MapFiles
memory mapped file or something else?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
hello,
I'm developing an application that should be able to display names of people from various corners of the world (ie, lots of languages at once). For that, I'd really like to be able to create a font that could handle all the unicode characters (or at least some kind of roman alphabet subset, but with all the punctuation and stuff, so that ie. Goethe would spell Gothe with an umlaut etc). I'm not sure such fonts are even installed (WXP).
I tried CreateFontIndirect, but since not even the LOGFONT structre has any attribute that would take "make it a unicode font", I don't know what to do next (and I really don't want to store language informoation and create multiple fonts etc). Any hints?
PS: I also tried looking at unicode.org, but still I'm unable to render most of the fonts
|
|
|
|
|
|
HI,
I HAV created a dialog box in which i have placed a static text control.
I have created one more dialog box say dialog2 in which i have a button control.
i want to bring dialog2 in to the static text control of first dialog and need to how to access the button control in dialog2 inside the static text control of dialog1.
plz let me know immediately,
thnx
zari
|
|
|
|
|
Send a message with SendMessage to the other dialog, process that message in the other dialog.
If you want to do it cleaner, you can use a registered message.
Hope this helps.
|
|
|
|
|
if we suppose CMain is dialog1 and Local is dialog2 you can use CMain *m_Main=(CMain*)GetParent(); m_Main->m_StaticControl
|
|
|
|
|
Having a dialog interact with controls it does not own is a bad design. Post a message to the second dialog instead.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
zareee wrote: want to bring dialog2 in to the static text control of first dialog and need to how to access the button control in dialog2 inside the static text control of dialog1.
plz let me know immediately,
Interprocess communication would be good. try http://www.codeproject.com/threads/#Inter%2DProcess+Communication[^]
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
I've built an SDI application without problems, adding classes. When I've linked a thirdy party library i've had to change compiler switch from Multithreaded (/MT) to Multithreaded DLL (/MD) and adding the _AFXDLL symbol to properly compile the entire project. The project is linked with the shard version of MFC.
When the application exits, i've noticed a lot of memory leaks and that classes destructors are not invoked (CView derived class and CMainFrame destructors are invoked, but CDocument destructor and other
classes destructors are not invoked).
I can't understand the causes of this problem and if the /MD compiler option is one of them.
Any idea ?
|
|
|
|
|
Take a look at where and how you create an instance of the class. The probable cause is that you have created an instance somewhere with the keyword new, and you are failing to call delete. If that class has other classes as members, their destructors will in turn fail to be called.
|
|
|
|