|
Ah yes, I recall reading about when you delete and when you don't - I use domodal almost exclusively, so I'm okay there.
Hadn't even noticed the sig, but then, I like it.
Charlie Gilley
Will program for food...
Whoever said children were cheaper by the dozen... lied.
My son's PDA is an M249 SAW.
My other son commutes in an M1A2 Abrams
|
|
|
|
|
Any resources that are associated with the HWND (such as timers) need to be cleaned up while the window still exists. THerefore, the destructor is the wrong place to clean up times since the window is already gone by the time the C++ object is destroyed.
|
|
|
|
|
hi
i wanna use *.exe file such az static library.
a static library included in my exe file, so i wanna my exe file involve another exe file(with out any source code from second exe file) and can run second exe file in my exe file.
it can be used to check authentication of user to use an unknown exe file.
can any one help me?
|
|
|
|
|
You can't "use" another exe as a static library. If the other exe exposes automation interfaces, you can make calls in it (or if it is a COM server/service). Otherwise, you can call it using a system call. The first case is not statically bound, and the system call is not bound at all.
If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week
Zac
|
|
|
|
|
I have an app now that takes input from a COM port and would like to add the ability to take input from a USB device such as a keyboard, barcode scanner, or other device.
I connected a barcode scanner to my machine and it looks like an HID to the machine - specifically a USB keyboard. I went into the HKLM\System\CurrentControlSet\Control\DeviceClasses registry entry and removed all the entries from there. I then plugged this scanner in again and noted the SymbolicLink values for the registry entries created.
I have another application that talks directly to USB printers, and to talk to them, I do a CreateFile with the SymbolicLink values from under the DeviceClasses registry entry. This works just fine, and I get back a valid handle.
When I do the same thing for this USB barcode scanner's entries, I get INVALID_HANDLE_VALUE back from CreateFile for each one.
I need to be able to differentiate input from the USB barcode scanner and a regular keyboard, since I can take input from the keyboard also.
Thanks for your help!
David
|
|
|
|
|
I have about the same problem.
Did you find a solution yet?
Allso, I'm searching how you can capture the barcode-imput while you don't allow it to be send to the active application (normally, when you have e.g. word open, the barcode-number is send as trext to the screen). I want the barcode number to be available without it being send to Word...
How can I do that?
Thanks.
-- modified at 2:41 Sunday 28th January, 2007
|
|
|
|
|
Environment is Visual C++ 2003 Standard Edition.
According to MSDN concerning the Properties view in Visual Studio Link[^]
Overrides
Lists all virtual functions for the selected class
and allows you to add or delete overriding functions. However, I have a class that derives from a class that derives from CObject. The object that derives from CObject has mostly virtual functions. However, if I click on any class, I cannot see those virtual functions in my properties view/overrides section. I only see the overrides for CObject regardless of the class selected.
Is it incorrect to expect my derived class' virtual functions to appear in the overrides section?
|
|
|
|
|
Seems like, it shows overridables from MFC classes only. But not mentioned in its description.
|
|
|
|
|
That appears to be the way it's behaving.
I am holding out hope that I'm not doing something right but it's becoming apparent that it's designed to only show their stuff.
Anyway, Thanks for the reply
|
|
|
|
|
Some of our users do not have a desktop computer, so myApp installs itself on the PocketPC using Autorun.exe. Currently I have a CF1 (compact framework) install program. I am upgrading myApp to CF2 so I need to write a C++ app to install the CF2 CAB file, then call my CF1 based install app to finish the program installation.
I have created a VS 2005 Wind32 Smart Device Project console program for autorun.exe. The return value from CreateProcess is 0, the lastError value is 87. Any help would be appreciated.
void _tmain( VOID )
{
STARTUPINFO si;
PROCESS_INFORMATION pi;
LPTSTR szCmdline=_tcsdup(TEXT("\"wceload \\2577\\NETCFv2.ppc.armv4.cab\""));
ZeroMemory( &si, sizeof(si) );
si.cb = sizeof(si);
ZeroMemory( &pi, sizeof(pi) );
BOOL res=CreateProcess( NULL, // No module name (use command line)
szCmdline, // Command line
NULL, // Process handle not inheritable
NULL, // Thread handle not inheritable
FALSE, // Set handle inheritance to FALSE
0, // No creation flags
NULL, // Use parent's environment block
NULL, // Use parent's starting directory
&si, // Pointer to STARTUPINFO structure
&pi ); // Pointer to PROCESS_INFORMATION structure
int lastError;
// Start the child process.
if( !res)
{
lastError = GetLastError()
printf( "CreateProcess failed (%d).\n", GetLastError() );
return;
}
// Wait until child process exits.
WaitForSingleObject( pi.hProcess, INFINITE );
// Close process and thread handles.
CloseHandle( pi.hProcess );
CloseHandle( pi.hThread );
}
-- modified at 13:04 Wednesday 13th September, 2006
|
|
|
|
|
Hallo, insted of my previes questien, can any one tell me a way to put image as background in a ListView in Bordlan c++??
Sorry for bad english!
Greatings
Sigmac
|
|
|
|
|
You can do that with LVM_SETBKIMAGE
|
|
|
|
|
Ok, thansk, but i have no eksperiens in coding beyond drag drop element, i have fount this code on the Net Perform() is it whit this?
And how?
Greatings
Sigmac
Sorry for bad english
|
|
|
|
|
I have solved the problem.
in event CustomDraw in ListView1
Graphics::TBitmap *pBitmap = new Graphics::TBitmap();
try{
pBitmap->LoadFromFile("ikke-navngivet.bmp");
Canvas->Draw(0,0,pBitmap);
pBitmap->TransparentMode = tmAuto;
Canvas->Draw(50,50,pBitmap);
}
catch (...){
ShowMessage("Could not load or display bitmap");
}
ListView1->Canvas->StretchDraw(ARect,pBitmap)
delete pBitmap;
Gratings
Sigmac
Sorry for bad english
|
|
|
|
|
Hi all,
I have a class inherited from CScrollView, and I have drawn
some lines,circle and text on it using it's device context.
Now What I want to do is to save all these pictures as a single bitmap file , How can I achieve it ,
Please Help me
Thanks in Advance
George K Jolly
|
|
|
|
|
Do you want to save shapes on device context in a graphic file like bmp,right?
|
|
|
|
|
|
If you have a hbitmap handle one easy way is use CImage class you attach this handle to this class and use of CImage::Save for save graphic file(bmp/jpg,etc)
|
|
|
|
|
Hello guys
I have a question: remember SpecialFX? Great water effect in images ....
Well, i wanna put this effects in my source in MASM (Macro Assembler).
Is possible using .obj? How can i call function? mangled names?
Tnx a lot.
|
|
|
|
|
I checked msdn, and got this
"Objects and variables declared as static retain their values for the duration of the program’s execution"....
but still don't know what is exactly the difference between declaring "int a" and "static int a", what is the difference when using them?
|
|
|
|
|
One difference is that a static variable is assigned a memory address before the applications code executes. A local variable is not pushed onto the stack until that function is entered.
led mike
|
|
|
|
|
int i
your variable will be created when the execution reaches this line, and it will be destroyed when leaving the scope.
static int i
your variable will be created when the program starts (whereever the statement is placed) and will be destroyed when the program exits.
|
|
|
|
|
again, I am still confusing...
is that
int i:
it will be ready when you start use it
static int i:
it will be ready long before you use it
So what's the use of the latter occasion? Since I don't use it, why should I care when it is created.
|
|
|
|
|
static has another meaning. when you declare a variable local to a function as static, then is keeps its last value :
void foo() {
static int i = 0;
i++;
printf("%d\n", i);
}
void main() {
for (int n = 0; n < 5; n++) {
foo();
}
}
this prints :
1<br />
2<br />
3<br />
4<br />
5
another meaning is when you declare a class data member as static. this means that the member is shared between every instances of the class. this is useful when you want a member to be unique, like an instances counter, class constants, etc...
the last meaning is when declaring a class member function as static. it will tell that the function is a class function ; it doesn't know a particuliar instance (no this pointer), it performs general operations...
|
|
|
|
|
bloodwinner wrote: again, I am still confusing...
is that
int i:
it will be ready when you start use it
static int i:
it will be ready long before you use it
So what's the use of the latter occasion? Since I don't use it, why should I care when it is created.
Imagine a function that animates something on the screen. Each call to the function updates the phase of the animation by using a counter to determine what's displayed. To this end you need an int as the counter and you declare it inside the function rather than having your primary program pass the counter to the function. If you declare the int as non-static but you increment the int each time you enter the function the value of the int goes away because the variable was created on the stack when the function began and it was removed when the function ended.
If you declare the int as static, whatever value it had on exit from the function is the value it will have when you call the function again because the variable was created before the program began execution and will not be destroyed until the program ends.
Lilith
|
|
|
|