|
I wrote a little article on calling conventions. However, you won't find anything about Pascal calling convention. It was replaced by stdcall in Win32
I vote pro drink
|
|
|
|
|
What is the function of "PASCAL" in function declaration?
Maer
|
|
|
|
|
What's the problem? You already got answered on this yesterday
|
|
|
|
|
Sorry, I post a wrong question.
What I want to know is "FAR PASCAL"
Thanks.
Maer
|
|
|
|
|
Hi
Im using the Refresh Method With ADO C++(I had to many problems with Createparameter Method)
bstr_t bstr = L"DSN=MEAS2SQL;
pCon->Open(bstr, (BSTR)NULL, (BSTR)NULL, -1);
pCommand->ActiveConnection = pCon ;
pCommand->CommandType = ADODB::adCmdStoredProc
pCommand->CommandText = _bstr_t("URBAN");
"It works with executing a stored procedure without parameters"
But when i inlude parameters with this lines i get the error.
pCommand->Parameters->Refresh();
pCommand->Parameters("@pkMbtID") = '160';
I get the error:
error C2064: term does not evaluate to a function
I spent several hours with this Plezz Help.
PS. They say CreateParametr is Faster then Refresh Method i wonder how much faster?
|
|
|
|
|
For a working ADO VC++ example, check out my web site:
userpages.umbc.edu/~bcorfm1/software.html
Look for the PhoneList program. Although the main program is in WTL, the ADO stuff is applicable to any framework. It includes usage for passing SQL queries with parameters, running stored queries, using Refresh, etc.
Best regards,
CodeGuy
The WTL newsgroup: 880 members and growing ... http://groups.yahoo.com/group/wtl
|
|
|
|
|
Thanx but i couldn't find anything using the "Refresh Method" or the "CreateParameter Method"
/Bigge
|
|
|
|
|
I made a mistake: I know you said Refresh, but I was thinking of Update instead. Sorry. :/
Let me see if I can help you though: I think you'll find that if you're trying to pass parameters to the DB, that you'd find it easier to pass the parameters like I'm doing in the code, rather than using CreateParameter. With MS Access, you pass a string "EXECUTE Authors 'Faulkner'" where 'Faulkner' is the query parameter. If you're passing numbers, don't use the single quotes.
For SQL Server, the only change is to use the CALL command instead of EXECUTE. This is documented inside the PhoneList's DBHandler class.
Best regards,
CodeGuy
The WTL newsgroup: 880 members and growing ... http://groups.yahoo.com/group/wtl
|
|
|
|
|
here is a example with Create Parameters
_RecordsetPtr pRS ;
_CommandPtr pcmdStoredProc;
try
{
hr = pcmdStoredProc.CreateInstance(__uuidof(Command));
if(FAILED(hr))
_com_issue_error(hr);
pcmdStoredProc->ActiveConnection = <Your Connection>
pcmdStoredProc->CommandType = adCmdStoredProc;
pcmdStoredProc->CommandText = _bstr_t("<Stored Proc Name>");
_ParameterPtr param;
_variant_t vtReturnVal(0L);
_variant_t vtReturnVal2(0L);
param = pcmdStoredProc->CreateParameter(_T("<Param 1 Name>"),adInteger,adParamOutput,sizeof(long),vtReturnVal);
pcmdStoredProc->Parameters->Append(param);
param = pcmdStoredProc->CreateParameter(_T("<Param 2 Name>"),adInteger,adParamOutput,sizeof(long),vtReturnVal2);
pcmdStoredProc->Parameters->Append(param);
param = pcmdStoredProc->CreateParameter(_T("<Param 3 Name>"),adInteger,adParamInput,sizeof(long), _variant_t((long)10));
pcmdStoredProc->Parameters->Append(param);
param = pcmdStoredProc->CreateParameter(_T("Param 4 Name>"),adInteger,adParamInput,sizeof(long), _variant_t((long)-1));
pcmdStoredProc->Parameters->Append(param);
pRS = pcmdStoredProc->Execute(NULL, NULL, adCmdStoredProc);
}
catch(_com_error& e)
{
CString sBuff = GetErrorDescription(e);
AfxMessageBox(sBuff);
return;
}
catch(...)
{
AfxMessageBox("Unknown Error Occured");
return;
}
|
|
|
|
|
Hi.
Help me to use database in dialog base program.
Iman Ghasr-e-fakhri
|
|
|
|
|
Hi.
what can I do to maneging mouse move event on buttons.
Iman Ghasr-e-fakhri
|
|
|
|
|
What are you asking ? WM_MOUSEMOVE is called when you move the mouse, and WM_LBUTTONDOWN/UP/etc are called when you press a button. To tell if a button is down as the mouse is moved you can use GetAsyncKeyState(VK_LBUTTON). You should call it twice, once to clear the buffer and once to check if it's down now, like so
GetAsyncKeyState(VK_LBUTTON); // may return true because it was down since the last check
if (GetAsyncKeyState(VK_LBUTTON))
// NOW we can do something
Christian
As I learn the innermost secrets of the around me, they reward me in many ways to keep quiet.
Men with pierced ears are better prepared for marriage. They've experienced pain and bought Jewellery.
|
|
|
|
|
Hi.
What can I do to chenge Edit Box (with CEdit) text color & BackGround color
Iman Ghasr-e-fakhri
|
|
|
|
|
How can I set a CEdit box up such that the enter key must be pressed before an OnChangeEdit Msg is generated? That is, the user must press enter before the edit box data is processed.
Thanks.
Richard
|
|
|
|
|
Hi My friends.
I want to use MFC Singel Document
to Type Equetio with "Breaking line" or "fraction line"
......2
....5x + 6
z=.--------
.....2y
(I don't know use this words corect or not) like this
I nead draw line and text together.
what can I do to have "Cursor" to type text & able to draw line .
Iman Ghasr-e-fakhri
|
|
|
|
|
Nothing - Windows is a graphical system - you can accept text and draw it into the view, and you can draw a line on the view as well.
Christian
As I learn the innermost secrets of the around me, they reward me in many ways to keep quiet.
Men with pierced ears are better prepared for marriage. They've experienced pain and bought Jewellery.
|
|
|
|
|
In MS Word 97, when I drag any toolbar (such as drawing toolbar) and drop it on the Word window, it becomes a window with small title bar, when I click on a button on the toolbar, the cursor on MS Word window still blink and MS Word window is still active. Vice versus, when I type, the toolbar window is still active. I try to create a window like that by the API Fuction CreateWindowEx and set window style as WS_Ex_TOOLWINDOW, and its parent as another window;
However, this window becomes de-active when I click on its parent window. I wish to receive any explaination for this phenomenon. Thank you very much.
|
|
|
|
|
I have a question that's realy bothering me.
when I look at the forums question and answers,
I see that the text is on a blue background and sometimes an example code on an orange background.
How do you do that ????
Name: STR
BTW: for some of you that wished for CodeProject irc server
I create a channle on DalNet called "#CodeProject"
|
|
|
|
|
This board accepts html tags in your posting. To include blocks of code you can use <PRE> or <CODE>
If I put in
<PRE>
Some text
</PRE>
I get:
Some Text
<CODE> Produces text
<br />
Like<br />
This<br />
(To make actual HTML appear as text you use "<" in place of "<")
|
|
|
|
|
Sagiv
this is done using the HTML tags <pre> and </pre>. You place them around your code and they keep the formatting exactly as you had it. Start your code immediately after <pre> on the same line or else you will get a blank line above your code. If you want to have a blank line between code you need to have a space on the line.
void main()
{
return;
}
Michael Martin
Pegasystems Pty Ltd
Australia
martm@pegasystems.com
+61 413-004-018
|
|
|
|
|
In properties on my MSFlexGrid I have Selectionmode by row.
But why is not the entire row highlighted when I click in the grid. The first colomn in the row is never highlightened, but the rest is highlightened.
|
|
|
|
|
Check that you have the property FocusRect to none, if not, the grid won't highlight the cell with the focus
|
|
|
|
|
void CExFormViewView::OnInitialUpdate()
{
CFormView::OnInitialUpdate();
CClientDC dc(this);
CPen pen, *oldpen;
pen.CreatePen(PS_SOLID, 1, RGB(255, 0, 0));
oldpen = dc.SelectObject(&pen);
dc.MoveTo(0, 0);
dc.LineTo(220, 100);
dc.SelectObject(oldpen);
}
The problem is to be not run the code above, at running for the first time.
The program is made to formview-based.
Help !!
|
|
|
|
|
Sorry if anyone feels I'm posting in the wrong forum, but this question did not really fit in in any of the others.
My problem is that I can't get the insertBefore method to work when adding new elements/nodes to my xml document.
This is my xml document:
<?xml version="1.0" encoding="ISO-8859-1"?>
<names>
<name>Flanders, Ned</name>
<name>Gumble, Barney</name>
<name>Skinner, Seymour</name>
</names>
Now I would like to do a insert with a new name "Simpson, Homer" so that it is placed before "Skinner, Seymour".
According to the MSDN specification the insertBefore method takes two arguments: newChild and refChild. But what confuses me is that refChild is supposed to be a variant, and not just a node pointer. I've tried different approaches but I've only managed to insert the new name at the end of the list.
Does anyone have some code samples using insertBefore in VC++? I would be very grateful. I've been looking for examples everywhere but found none that helps me.
Thanks!
|
|
|
|
|
Jimmy,
I use the following code to do this:
_variant_t varBeforeNode(pBeforeNode.GetInterfacePtr(), false);
pParentNode->insertBefore(pNewNode, varBeforeNode);
This also works if you pass 0 as pBeforeNode, in which case
the element is appended to the end of the list.
Alwin Beukers
|
|
|
|