|
One more way to achieve this. Save one function call,too.
TCHAR infoBuf[INFO_BUFFER_SIZE];
GetComputerName( infoBuf, &bufCharCount );
basic_string<TCHAR> pc(infoBuf);
|
|
|
|
|
Thnx Prasad,
But my fubction accepts a std::string and when I do this:
TCHAR infoBuf[INFO_BUFFER_SIZE];
GetComputerName( infoBuf, &bufCharCount );
basic_string <TCHAR> pc(infoBuf);
this would happen:
Error 1 error C2664: 'CIniFile::SetValue' : cannot convert parameter 2 from 'std::basic_string<_Elem,_Traits,_Ax>' to 'std::string' c:\documents and settings\qx55246\my documents\visual studio 2005\projects\testsmsintferface\testsmsintferface\testsmsintferface.cpp 32
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r
|
|
|
|
|
If your language/tool supports WideCharToMultiByte and MultiByteToWideChar functions, you may use them for ASCII<->UNICODE string conversion.
Hope this helps.
Anand
|
|
|
|
|
how .tlh file get generated ? iam using vc 6.
|
|
|
|
|
You need to import valid type library in your project.
#import "MyComObj.tlb"
|
|
|
|
|
Hi all,
I am trying to build a application but i got error as follows :
FileToFile fatal error C1192: #using failed on 'c:\compression\from ecl\filetofile\debug\AxInterop..dll'
also this application have successfully build on other machine.
how can i solve this problem please suggest me .
thanks
bankey.
|
|
|
|
|
Banks K wrote: AxInterop..dll'
Are the double dots in the file name intentional?
Alcohol. The cause of, and the solution to, all of life's problems - Homer Simpson
|
|
|
|
|
Hi all,
I have created an ActiveX dll in VB and imported in VC++. Everything went fine, untill i defined a new function in the DLL. Now how do i make that function appear in MFC class.
|
|
|
|
|
I am having a union with a class member, that class has a
copyconstructor compiler is giving me error about that.
Is anything can be done about it or some round about.
|
|
|
|
|
sujeet_kulk wrote: I am having a union with a class member
How about a different design?
led mike
|
|
|
|
|
You can't: logically it makes no sense. How would the union know which constructor to call?
Steve
|
|
|
|
|
A union cannot contain a member having a copy constructor.
Revise your design.
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.
|
|
|
|
|
what is the syntax for calling stored procedure
|
|
|
|
|
is in the documentation at msdn.microsoft.com
"Alot of the people on this forum are incredibly stupid, thinking that the internet is real" Score: 1.0 in the Soap Box
led mike
|
|
|
|
|
abrakadbra wrote: what is the syntax for calling stored procedure
From?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Dear All,
I want to use virtual memory more rather than main memory.
I need virual memory usage techniques those can be applied for application that has no user interfaces (Dialogs).
Kindly let me know.
Thanks.
|
|
|
|
|
Virtual memory usage it's not up to you. OS provides that to applications.
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.
|
|
|
|
|
|
BOOL bRetVal;<br />
hKey = HKEY_CURRENT_USER;<br />
path = "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced";<br />
DWORD data = 1;<br />
DWORD datas = sizeof(DWORD);<br />
RegOpenKeyEx(hKey, path, NULL, KEY_QUERY_VALUE, &hKey);<br />
<br />
bRetVal = RegSetValueEx(<br />
hKey, <br />
"Start_SearchFiles", <br />
NULL, <br />
REG_DWORD,<br />
(CONST BYTE *) data,<br />
datas<br />
);<br />
if (bRetVal == ERROR_SUCCESS)<br />
{<br />
MessageBox("set");<br />
}<br />
else<br />
{<br />
MessageBox("set failed");<br />
}<br />
RegCloseKey(hKey);
ive tryed everything i can think of and every time set failed goes off can someone point out what im missing?
|
|
|
|
|
I guess it is because you are opening the registry key with KEY_QUERY_VALUE access. This will allow only query and not set.
« Superman »
|
|
|
|
|
locoone wrote: what im missing?
What you are missing is "reading" the documentation[^]
Parameters
hKey
[in] A handle to an open registry key. The key must have been opened with the KEY_SET_VALUE access right.
led mike
|
|
|
|
|
locoone wrote: RegOpenKeyEx(hKey, path, NULL, KEY_QUERY_VALUE, &hKey);
Here you need to set KEY_SET_VALUE , as mentioned earlier.
locoone wrote: bRetVal = RegSetValueEx(
hKey,
"Start_SearchFiles",
NULL,
REG_DWORD,
(CONST BYTE *) data,
datas
);
You need to pass address of data , instead you have type casted data itself to (CONST BYTE *) .
So you call can be modified as,
bRetVal = RegSetValueEx(
hKey,
"Start_SearchFiles",
NULL,
REG_DWORD,
(CONST BYTE *) (&data),
datas
);
|
|
|
|
|
//This is dll function which i am calling to insert data
<br />
short setQuoteToDB(BSTR* strDateTimeStamp, short* intMarketNo, BSTR* strMarketName, BSTR* strBid, BSTR* strAsk, short* intMarketState);<br />
// This is function from which i am getting data fom remote server
<br />
void CArielProjectVer2Dlg::OnPriceChangeArielapictrl1(LPCTSTR SessionId, LPCTSTR RequestId, short MarketNo, LPCTSTR Market, LPCTSTR Bid, short BidDirection, LPCTSTR Ask, short AskDirection, LPCTSTR High, LPCTSTR Low, short MarketState, LPCTSTR Timestamp) <br />
Now when i call this dll function....setQuotetoDB...by passing parameter i got error
<br />
setQuoteToDB(Timestamp,marketno,Market,ask_d,bid_d,marketstate);<br />
What should i do so that i can insert data...in database...any help...
|
|
|
|
|
abrakadbra wrote: Now when i call this dll function....setQuotetoDB...by passing parameter i got error
Which error ?
|
|
|
|
|
setQuoteToDB' : cannot convert parameter 1 from 'const char *' to 'unsigned short ** '
|
|
|
|