|
There are multiple Run sections...
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run will execute the application before anyone logs into the system
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run will execute the application when that user (the current one) logs in...
Just make a new String Value (REG_SZ) and give it a descriptive name "My Application" then set the value of the String to the location of the executible C:\.....\somthing.exe
-=[ QuieT Cha0s ]=-
|
|
|
|
|
Is there any way i can get all the table names of a database in Access or SQL progmatically??
|
|
|
|
|
Yes. If you're using OLE-DB or ADO you can use OpenSchema to give you a schema rowset, if you're using ODBC you can use SQLTables...
Steve S
|
|
|
|
|
This will get all tables from access or any other
_ConnectionPtr pCon;
_RecordsetPtr pRs;
_bstr_t bstrTableType("TABLE");
_variant_t varCriteria[4];
varCriteria[0].vt = VT_EMPTY;
varCriteria[1].vt = VT_EMPTY;
varCriteria[2].vt = VT_BSTR;
varCriteria[2].bstrVal = mytable;
VARIANT varData;
SAFEARRAY FAR* psa;
SAFEARRAYBOUND rgsabound[1];
rgsabound[0].lLbound = 0;
rgsabound[0].cElements = 4;
psa = SafeArrayCreate(VT_VARIANT, 1, rgsabound);
for( long lIndex = 0 ; lIndex < 4 ;lIndex++)
{
SafeArrayPutElement(psa, &lIndex,&varCriteria[lIndex]);
}
varData.vt = VT_VARIANT | VT_ARRAY;
V_ARRAY(&varData) = psa;
try
{
TESTHR(pCon.CreateInstance(__uuidof(Connection)));
TESTHR(pCon->Open(,"","",NULL));
pRs = pCon->OpenSchema(adSchemaTables);
while(!pRs->EndOfFile)
{
_bstr_t bsTableName = pRs->Fields->GetItem("TABLE_NAME")->Value;
pRs->MoveNext();
}
pRs->Close();
pCon->Close();
}
catch(_com_error e)
{
HandleComError(e);
}
Hope it helps
C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do, it blows away your whole leg
|
|
|
|
|
For Microsoft SQL, use the sp_tables_ex stored procedure.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
VARIANT v;
v.vt = VT_BOOL;
v.boolVal = 0;
Maybe this will work? You're initialisation of the VARIANT is not correct. If you want to place a boolean in your VARIANT, then set the type to VT_BOOL.
Er zit een korstje op mijn aars.
|
|
|
|
|
I tried with VT_BOOL.. still it doesnt work...
Also I tried declaring a function with same signature and that function call works but the one i am trying doesnt.....
Can u please tell me what can be the problem...
I am stuck from last 6 hours on this
modified 21-Apr-21 21:01pm.
|
|
|
|
|
Two things. Firstly, you aren't initializing the variant properly, you've said it's a variant, but set the boolVal member.
Did you mean
vart.vt = VT_BOOL;
vart.boolVal = 0;
You don't specify which file/line the error occurs on. The message implies you are performing some kind of
dest = src;
where src is a VARIANT thing. If this is the case, you might be trying to assign the variant rather than one of it's union members.
Steve S
|
|
|
|
|
Hi Steve,
Yes I meant doing ---
vart.vt = VT_BOOL;
vart.boolVal = 0;
But even after doing that the error persists.
The error occurs at --
c.MemberFunc("hello", vart);
call
I know abt dest = src;
But steve I also tried writing another function with the same signature as
MemberFunc(...);
and passesd same parameters [ ie. NewFunc("hello", vart); ]
But the compiler gives no error for this call.
I am really confused
Help me out
modified 21-Apr-21 21:01pm.
|
|
|
|
|
I'm not exactely sure what the problem is, but perhaps you haven't initialised your VARIANT using 'VariantInit'. Don't know for sure if this is necessary though.
Er zit een korstje op mijn aars.
|
|
|
|
|
Hi, I've created an app which is using the CHtmlView.
When i create (from html)a window or html-dialog that covers part of the main CHtmlView and then closed - this region is not being re-painted.
I am trapping OnEraseBkgnd() which is notifying me that part of my background has been erased, but i don't know what to call to cause the RePaint.
I have tried InvalidateRect but this seems to blank the page completely.
Your help would be much appreciated
Carl
|
|
|
|
|
InvalidateRect is only half the process. This call tells Windows that a portion of the window should be repainted the next time a WM_PAINT message is sent to the window. In order to force an immediate repaint after one of the Invalidate* calls, you need to call UpdateWindow() .
Software Zen: delete this;
|
|
|
|
|
Gary Wheeler wrote:
InvalidateRect is only half the process. This call tells Windows that a portion of the window should be repainted the next time a WM_PAINT message is sent to the window. In order to force an immediate repaint after one of the Invalidate* calls, you need to call UpdateWindow().
tried the following with last parameter to Invalidate set to 0 also.
Just paints white over all html controls on the page. Can only get them to show by clicking mouse over each region
BOOL CTestEngine4View::OnEraseBkgnd(CDC* pDC)
{
// TODO: Add your message handler code here and/or call default
//MessageBox("erase");
CRect rcClient;
GetClientRect(&rcClient);
InvalidateRect(&rcClient,1);
UpdateWindow();
return CHtmlView::OnEraseBkgnd(pDC);
}
|
|
|
|
|
Sorry; I didn't read your original post closely enough .
Take a look at this article[^] in the MSDN; it describes the problem you're experiencing, and how to fix it.
Side note: OnEraseBkgnd is called during the window painting process. As a result, calling InvalidateRect and/or UpdateWindow during that process would only confuse the issue. The window is in the process of being drawn, and you're telling it that the entire window needs updated, and then update the window (and Windows says "but I'm already updating it!")...
Software Zen: delete this;
|
|
|
|
|
thanks Gary - i found that OnErase gets called whenever another frame covers a region of an existing frame. By returning 'true' at this point the repaint works fine. (not entirely sure why)
However the article you pointed me too clears things up - thanks alot!
Carl
|
|
|
|
|
Hello
I need to developp an application which controls a card via USB port. Does someone have a good C++ class which defines the USB communication protocol?
Thank's for advance.
|
|
|
|
|
USB is not like serial port. You need kernel driver, or your device should support some standard protocol like HID to use built-in drivers. Check http://www.lvr.com/[^] for more.
|
|
|
|
|
Driver is ok. My device is well recognized by MS windows.
I just need to create a C++ usb class in order to define the communication protocol. Do you have more informations about this?
|
|
|
|
|
jeab. wrote:
I just need to create a C++ usb class in order to define the communication protocol. Do you have more informations about this?
How the device is recognized? Communication depends on device interface, there is no generic way. Many cards/monitor hardware with low traffic implements the hid interface. There you use read/writefile with specially constructed packets called reports. Each device defines its own report format. The link I gave has sample code.
|
|
|
|
|
The driver of the device was given with another application which works with.
I have to use the USB fonctionality of my device (which is controllable with a serial port RS 232) to control it by the application I have to adapt for.
I just want to know the functions I have to declare in my new CUsbCtrl class.
I see 3 functions (USBTxStart, USBTxDone, USBTxAbort) but I don't know how to make them.
|
|
|
|
|
I try your sample code but the file "hidsdi.h" is not given in your package.
|
|
|
|
|
It's not my code. This file is from windows ddk, you need it to compile.
|
|
|
|
|
You need the ddk to compile.
|
|
|
|
|
Hi,
Can anyone tell me how to find if a file is already open.This is to prevent two instances of the same file.
Thanks.
Deepak Samuel.
Deepak Samuel.
|
|
|
|
|
Try to open the file again. If it is opened elsewhere, you'll get an appropriate error.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|