|
Thank you for the suggestion.
The OS where I am creating registry entries is Windows NT.
|
|
|
|
|
requesting the regsam=KEY_ALL_ACCESS will fail if your user is not an administrator.
This behavior is modified on Vista but that's a story for another day...
|
|
|
|
|
Hello,
Suppose I have
vector<CString>StringVector
vector<int>IntVector
If I have above strutures in my program then do I need to worry that CString will take up variable number of bytes for each member of the vector and it may cause problems while accessing data in the vector
As otherwise each member in the IntVector is going to take up equal number of bytes so accessing member from IntVector is fine.
Please tell me whether I should take care while making a vector of CStrings .
Prithaa
|
|
|
|
|
prithaa wrote: Please tell me whether I should take care while making a vector of CStrings
Use 'iterator's for accessing the objects stored in the vector and forget about the difficulties in accessing those..
Do your Duty and Don't expect the Result Rate this Post, if I helped You
|
|
|
|
|
No, you don't have to worry about that because the CString object contain a pointer to the real buffer array.
But I'm wondering why you are using CString with the STL ? Why don't you use std::string to keep consistent ?
|
|
|
|
|
because std::vector is better than MFC's containers maybe ?!
|
|
|
|
|
toxcct wrote: because std::vector is better than MFC's containers maybe ?!
Yes, but I said: Why don't you use std::string to keep consistent ?
|
|
|
|
|
because CString is easier to use than std::string ?
|
|
|
|
|
Errr... Well, I don't have anything more to add
|
|
|
|
|
Cedric Moonen wrote: Errr... Well, I don't have anything more to add
thanksfully, cause i didn't have further arguments either
|
|
|
|
|
Hello,
May be I am repeating myself
If I have vector<CString>
Will reallocation occur when there is change
in size of CString?
Will the entire operation O(n) take more time in reallocation thereby being expensive performance wise?
You said that I should not worry about memory allocation
but will that affect my performance and calculations if there are any
Prithaa
|
|
|
|
|
Can anyone please help, how do you send an entire file using client/server and a dll....
|
|
|
|
|
What DLL ?
What about recv and send ?
|
|
|
|
|
bbvnvbnbnbnbn wrote: client/server and a dll....
No. Send it through DHL. It is faster and reliable.
|
|
|
|
|
I have a server which is waiting for connection requests. When it gets a connection request from a remote client CMySocket::OnAccept() is being called ...then there i want to know the client IP Address from which the request is coming. Is it possible?
Thank you.
KIRAN PINJARLA
|
|
|
|
|
Inside OnAccept(..), call
Accept(CAsyncSocket& rConnectedSocket, SOCKADDR* lpSockAddr, int* lpSockAddrLen);
if Accept succeeded then, lpSockAddr will have the IP address of the connecting machine.
Hope CMySocket is CAsyncSocket
Do your Duty and Don't expect the Result Rate this Post, if I helped You
|
|
|
|
|
Thank you Parthi,
But i want to know from which the connection request is generated, and according to the rights they have i will decide to accept or reject. Is there a way to do this?
KIRAN PINJARLA
|
|
|
|
|
If the protocol is TCP then the only information you have is the remote peer's IP address (as
"seen" by your server). Any authentication you'll have to do yourself.
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
Hi
I want to explain the situation that I am in trouble then I will ask a question.I have four dialog boxes (Dlg1,Dlg2,Dlg3,childDlg).Each of Dlg1,Dlg2 and Dlg3 has a edit box and a button.The buttons are creating the childDlg and childDlg is sending a string for edit box of the dialog box which created the childDlg.But I couldn't find which one created the childDlg.I am using this line to get parent:
Dlg1 *dlg1 =(Dlg1 *) GetParent();
But I cannot find if it is Dlg1,Dlg2 or Dlg3.How can we do that?
I have another problem.Can we set a pointer to the edit box of the dialog box which created childDlg?Because the names of member variables which were declared for edit boxes are different.
I think about a complex solution but I know it is a very bad programming.Maybe you can find a simple solution.
|
|
|
|
|
You can distinguish the windows by their handles. BTW you can also pass some kind of identifier to the dialog, before calling the DoModal method (you can define you own method, for instance SetParent , in your childDlg class).
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.
|
|
|
|
|
The CDialog constructor accepts a pointer to the parent window. Doing it like this should be all you need:
<br />
void CMyDialog::DoSomething()<br />
{<br />
CMyOtherDlg dlg(this);<br />
dlg.DoModal();<br />
}<br />
If you don't pass in a parent window pointer (for modal dialogs), I believe MFC apps assume that the parent is the main app window itself.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
i built my application on VC 2005 and trying to run on some other machine where VC 2005 is not available but some error message is occuring i.e(This application has failed to start because the application configuration is incorrect. reinstalling the application may fix this problem).
i got some solution from http://blogs.msdn.com/nikolad/archive/2005/03/18/398720.aspx but i am not able to understand what exectly he want to convay like "x86_Microsoft.VC80.CRT" if anyone can help then i can test my application even on some dummy Pc
Thanks
RYK
|
|
|
|
|
Are you running application in Vista?
If your application contains many modules try testing module by module so that you can find which part cause problem. There are many chance for failure. For example file open with write request may fail.
Also try switch off optimization of compiler.
Best Regards,
Suman
|
|
|
|
|
No i am using XP and i have only one module with some function.hardly 2 files are there.
with regards
RYK
|
|
|
|
|
Maybe this[^] article will help.
In brief, there is no easy solution (like distributing the dll's with your exe).
|
|
|
|