|
How do i handle events for a Cbutton object created at run time ? Are there many ways of doing this ?
|
|
|
|
|
If you know the ID of the generated buttons at build time (or the range) you could put an ON_COMMAND( id, handler ) entry in the container's message map, but you'll want to put it outside the section managed by the class wizard.
Check out ON_COMMAND_RANGE as well, which might be more useful.
Steve S
|
|
|
|
|
Hi ,
If i do that how do I maintain an unique identifier for my Button !
as of now I am doing this
resetButton->Create("Reset Data",0,bRect,parent,0);
Engineering is the effort !
|
|
|
|
|
Assuming that the CButton is being placed on a dialog and it is not always needed, then use the dialog editor to place the button and set the visibal propety to false. That way you can change it to true only when it is required.
If you are placing the button on a window, you could try processing the command in the preprocessor function before it is passed to the window, or add you own WM_COMMAND() to the message map and add the function to handle it manualy.
INTP
|
|
|
|
|
How do you add messages to the mess. map for controls that are not created using the Dialog Editor, but in run time?
|
|
|
|
|
Having a problem with some registry keys. The MFC command ReqQueryValueEx requires that the name of the key be passed as a pointer to a null-terminated string, or to use their wrapper, an LPTSTR. My project accepts a vector of std::strings. Is there an easy way to convert those into LPTSTR's? I've tried every cast and conversion I could think of, but I don't know these types too well. Thanks.
"He looked rather, in his coat, like a sack full of elderly squirrels attempting to escape."
- Douglas Adams
|
|
|
|
|
LPTSTR is equivalent to char* or wchar_t*, depending on whether you've an MBCS/ANSI or UNICODE build respectively.
Steve S
|
|
|
|
|
Sorry, I should have been more clear with my first post, I was in a hurry. I thought the problem was most likely with how I'm using RegQueryValueEx. Here's what my code looks like:
queryD = RegQueryValueEx(curKey, names[m].c_str(), NULL, &datatype, (LPBYTE)buffer, &bufferlength);
where: curKey = open HKEY, names = std::vector{std::string}, datatype = DWORD, buffer = TCHAR[], and bufferlength = DWORD
This compiles and runs, but does not successfully open any of the keys that it is passed, the return value is 234. As a longtime *nix programmer just making the move to MS programming, I'm starting to get frustrated with this. Any help you could offer would be greatly appreciated.
|
|
|
|
|
badsmonkey wrote:
...the return value is 234.
Which means there is more data. Go forth and get it!
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
What, exactly do you mean?
|
|
|
|
|
Exactly what it sounds like. RegQueryValueEx() is telling you that more data exists. Consult the docs for more details.
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
|
Hi there !
I need to use a web service written in VB.NET .
i want to write a C++ client to use the service. how can
we do it in C+
Abhi....
|
|
|
|
|
Read this[^]. It may not be the ideal approach you are looking for but it is a start.
Good luck.
P.S. You need to install Microsoft Soap Toolkit 3.0 (or 2.0).
[Edit] The service URL has to be in the format "http://MyServer/MyDir/MyService.asmx?wsdl" (note the ?wsdl at the end) [/Edit]
My articles and software tools
|
|
|
|
|
You may try something like that, assuming your Soap request envelope is stored in lpcsSoapEnvelopeFileXML:
MSXML2::IXMLDOMDocument2Ptr request(__uuidof(MSXML2::DOMDocument30));<br />
BOOL bretval;<br />
<br />
request->async = false;<br />
bretval = request->load(lpcsSoapEnvelopeFileXML);<br />
if(bretval)<br />
{<br />
MSXML2::IXMLHTTPRequestPtr serv (__uuidof(MSXML2::XMLHTTP30));<br />
serv->open ("POST",lpcsURL, false);<br />
serv->setRequestHeader ("Content-Type", "text/xml; charset=utf-8");<br />
serv->setRequestHeader ("SOAPAction", lpcsFuncURL);<br />
serv->send (_variant_t(request->xml));<br />
<br />
MSXML2::IXMLDOMDocument2Ptr response;<br />
response = serv->responseXML;<br />
<br />
csResponce = (LPCSTR)serv->responseText;<br />
}<br />
return csResponce;
On return you have to parse csResponce text or response XML...
"...Ability to type is not enough to become a Programmer. Unless you type in VB. But then again you have to type really fast..."
Me
|
|
|
|
|
ThankX igor1960
It works nicely.
Abhi....
|
|
|
|
|
ThankX igor1960
It works nicely.
Abhi....
|
|
|
|
|
i am writing a download software, but i don't know the protocol of mms . where i can find this ?
help me ~
thanks
i love j2ee and vc.
|
|
|
|
|
i am writing a download software, but i don't know the protocol of mms . where i can find this ?
help me ~
thanks
i love j2ee and vc.
|
|
|
|
|
Which of the dozen or so are you interested in:
Manufacturing Monitoring System
Mass Mailing System
Maintenance Management System
Mail Management System
Manufacturing Message Service
Material Management Services
...
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
Hi
I have installed Visual Studio including VC++.
I can set my include & link directories correctly and i can compile & link a project (which needs specific sources in other directories) perfect.
When i exit VC++, i loose all include directories & all library directories that i have added.
(the standard directories remain)
So i got to reenter all the info again.
Is this a bug in VC and how can i fix it?
Or is there a script that i can make to set the include & link dirs correctly? (dos script?)
Thanks alot for the help
BaRT
|
|
|
|
|
When you say "I can set my include ..." are you doing this by "Tools/Options/Directories"?
You should do this with one copy of VC++ only running, and exit straight away.
This should save the appropriate registry settings, in HKCU\Software\Microsoft\DevStudio\6.0\Build System\Components\Platforms\Win32 (x86)\Directories, providing you're using vc++6
Steve S
|
|
|
|
|
Strange .......
cauz these paths are stored under specific user settings , if u login with same user , path must remain stored.
You better try it , opening single instance of IDE.
No Worries!
|
|
|
|
|
Hi
Yes, i've added those by using Tools,Options.
I've checked the reg key and added some include dirs ... but this doesn't affect the tools, options include dir.
and i only open a single instance too
So i have to worry :x
|
|
|
|
|
I don't want to use the .Net framework and I was wondering if there was an equivalent to those 2 classes in MFC on Win32...
Thanks!
---------------
Tired of Spam? InboxShield for Microsoft® Outlook® 2K/2K2/2K3
http://www.inboxshield.com
|
|
|
|