|
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
|
|
|
|
|
I have rich edit View in my application. when run in the debug mode it gives an assertion stating the line 189 in winocc.cpp but runs fine in release mode. Can anyone suggest some solution asap.
Reagrds,
Samir Sood
Samir Sood
|
|
|
|
|
Have you looked at line 189 of winocc.cpp? There's a big clue there.
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
|
Yes I have But it only indicates that handle to window is not there but if this was the case then why does the code run in the release mode
Samir Sood
|
|
|
|
|
I have a CFile object. I am dealing with a file with it. After my work is over i am calling CFile::Close();
CFile m_file;
m_file.Close();
after calling Close() , i need to know whether the file is closed or not. How can i do so?? Actually, my program is calling m_file.Close() two times. When i call second time, the program crashes. So before calling Close(), i want to know wheter file already been closed or not ??
|
|
|
|