|
Hmmm... what terrible terrible thing have you done to get yourself into this mess!
"Inquiring minds want to know..."
Well, it could be that the process is being debugged as far as the system is concerned, making it tough to kill, so you might try exiting msdev first (or killing that). Hey, what happens if you try Debug | Attach to process, or try to attach the debugger through task manager?
I think you _should_ have the debug priv if you're an admin on 2000.
What is the mechanism for preventing multiple instances - would it make a diff if you disabled that?
|
|
|
|
|
Got it - I think.
The MIDI ports are not being closed. If I execute the code in such a way as to prevent them from ever being opened, the app will shut down and start up again propelry. If the ports are open when I shut down or crash.. the app won't terminate.
Shee-it. So now all I have to do is figure out how to shut them down after a crash. No big deal - right? (I'm being sarcastic, of course.)
|
|
|
|
|
Is there anyway to force the focus to go to a specific ListView Item after certain action?
I have tried the following after a label edit:
::SetFocus(pDispInfo->hdr.hwndFrom);
but it doesn't seem to work.
Any ideas anyone?
|
|
|
|
|
You can use SetItemState to set the state of the item to LVIS_SELECTED.
|
|
|
|
|
I was wondering if you could search for a string of text in a char variable?
-Matt Newman
|
|
|
|
|
Well, depending on what you mean, yes:
CString::Find()
or maybe
strstr()
|
|
|
|
|
Ok, I was hoping to use the char format but I guess I can convert it.
-Matt Newman
|
|
|
|
|
See, that's what I meant when I said "depending on what you mean".
You can't search a char for a string. A char is one char. A string is many. What you apparently want to do is search a string - an array of chars - for a string. In that case, you want strstr().
|
|
|
|
|
strchr(yourstring, ch) will do this. Or, if you prefer STL lifestyle, std::string::find.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
Hi all,
I have a situation where I wish to pass a NULL to a varchar(200) parameter
of an SQL Server stored procedure using ADO and Visual C++.
I have tried various things, but with no success.
Anybody done this before?
Thanks,
Bob.
|
|
|
|
|
you can try
variant_t vtNull;
vtNull.ChangeType(VT_NULL);
and pass that. There is no constructor to make a variant NULL from the
start.
Also make sure the size parameter is 200 as your varchar is defined with a length of 200.
|
|
|
|
|
What is the difference between C and Pascal calling convention ? I have heard that pascal calling convention saves bytes - Is it true ? IF true how ?
|
|
|
|
|
The C calling convention puts the parameters on the stack from right to left, this allows the C calling convention to have an limitless parameter list like in the printf function. The caller pops parameters from the stack.
The pascal calling convention is obsolete in WIN32, but it passes its parameters from left to right.
I am not sure, but I believe that the callee pops parameters from the stack frame.
|
|
|
|
|
The pascal (stdcall) calling convention is not obsolete in Win32. Most of the Win32 API uses it. Is has various macros to describe it such as WINAPI, CALLBACK, APIPRIVATE, PASCAL, and IMAGEAPI. It is used for two reasons : first so that multiple programming languages can be supported and second because M$ claims that it is slightly more efficient. Whatever.
You are right that the callee fixes the stack. This is done by adding the number of bytes that were pushed back to ESP.
BTW: I actually do have something that resembles a life but I have spent lots of time reading .cod listings.
|
|
|
|
|
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
|
|
|
|