|
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 ** '
|
|
|
|
|
You are passing LPCTSTR in place of BSTR* .
Convert LPCTSTR to BSTR by using
USES_CONVERSION;
BSTR b =A2BSTR(lpszText); and pass it address to wherever BSTR* is required.
|
|
|
|
|
Can you tell me more clearly...by writing one converting data type...i am very thankful to you
|
|
|
|
|
abrakadbra wrote: setQuoteToDB(Timestamp,marketno,Market,ask_d,bid_d,marketstate
This call would go like,
USES_CONVERSION;
BSTR bsTimeStamp = A2BSTR(Timestamp);
BSTR bsMarket = A2BSTR(Market);
BSTR bsBid = A2BSTR(Bid);
BSTR bsAsk = A2BSTR(Ask);
setQuoteToDB(&bsTimeStamp,&marketno,&bsMarket,&bsAsk,&bsBid,&marketstate);
SysFreeString(bsTimeStamp);
SysFreeString(bsMarket);
SysFreeString(bsBid);
SysFreeString(bsAsk);
|
|
|
|
|
I am really thankful for your effort....i am trying to solve this from past 20 days
but now i am getting error for
'setQuoteToDB' : cannot convert parameter 2 from 'class CString *' to 'short *'
How to solve this....pls
|
|
|
|
|
I have define
1)marketno and market state as CString to format(marketno.Format("%d",MarketNo);
2)marketstate.Format("%d",MarketState);
|
|
|
|
|
you are not going to hlp me anymore????pls help me....
|
|
|
|
|
To make others solve your problem, you need to give complete/clear problem definition.
You can convert CString to BSTR using CString::AllocSysString() .
|
|
|
|
|
This is the complete code i am using and geeting error for marketno,and marketstate
setQuoteToDB' : cannot convert parameter 2 from 'unsigned short ** ' to 'short *'
<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 />
{<br />
SessID=SessionId;<br />
CurrentRequestId=RequestId;<br />
txtMarket = Market;<br />
<br />
marketno.Format("%d",MarketNo);<br />
bid_d.Format("%c",BidDirection);<br />
ask_d.Format("%c",AskDirection);<br />
marketstate.Format("%d",MarketState);<br />
<br />
<br />
m_MainEdit=m_MainEdit + "<Price Change>" + SessionId + RequestId + marketno ; <br />
m_MainEdit=m_MainEdit + Market + Bid + bid_d + Ask +ask_d + High ;<br />
m_MainEdit=m_MainEdit + Low marketstate + Timestamp + "\r\n";<br />
<br />
UpdateData(FALSE);<br />
iLineCount=m_EditCtrl.GetLineCount();<br />
m_EditCtrl.LineScroll(iLineCount);<br />
<br />
USES_CONVERSION;<br />
BSTR bsmarketno = marketno.AllocSysString();<br />
BSTR bsTimeStamp = A2BSTR(Timestamp);<br />
BSTR bsMarket = A2BSTR(Market);<br />
BSTR bsBid = A2BSTR(Bid);<br />
BSTR bsAsk = A2BSTR(Ask);<br />
<br />
setQuoteToDB(&bsTimeStamp,&bsmarketno,&bsMarket,&bsAsk,&bsBid,&marketstate);<br />
<br />
SysFreeString(bsTimeStamp);<br />
SysFreeString(bsMarket);<br />
SysFreeString(bsBid);<br />
SysFreeString(bsAsk);<br />
<br />
<br />
Error:
<br />
setQuoteToDB' : cannot convert parameter 2 from 'unsigned short ** ' to 'short *'<br />
|
|
|
|
|
abrakadbra wrote: setQuoteToDB(&bsTimeStamp,&bsmarketno,&bsMarket,&bsAsk,&bsBid,&marketstate);
Second parameter is short* , you need to pass address of MarketNo .
Your call would be like ;
setQuoteToDB(&bsTimeStamp,&MarketNo,&bsMarket,&bsAsk,&bsBid,&marketstate);
|
|
|
|
|