|
ndalal wrote:
I'm not sure if it can execute a batch file.
Yes, it can be used with .bat files.
I do not think NULL is a valid option for the ninth parameter.
The do/while loop seems unnecessary as WaitForSingleObject() will do its own waiting without using any processor time. As you have it written, WaitForSingleObject() will wait indefinitely for the object's state to become signaled, but will then loop infinitely as the state will remain signaled.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
|
I am using a dialog based application.
The application will generate a report after doing a lot of testing.
I want the report to be printed whenever the user presses one button from the dialog box.
Can anyone help me.
Joesam
|
|
|
|
|
See this article[^] by Richard Stringer. Should have everything you ever need in printing from MFC programs.
-Antti Keskinen
----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
|
|
|
|
|
This article of mine MFC CDialog print/preview extension[^] will do exactly what you need.
Roger Allen - Sonork 100.10016
Strong Sad:
Clever I am? Next to no one.
Undiscovered and soggy.
Look up. Look down. They're around.
Probably laughing. Still, bright, watery.
Listed among the top. Ten.
Nine. Late night. Early morn.
Early mourn. Now I sleep.
|
|
|
|
|
Hey guys,
here is the problem:
I have to keep an static array of pointers of type base class , and I should be able to assign each of these pointers to any of the derived class..
here is the code...
class Base
{
public:
static Base* basePtr[10];
}
class derived1 : public Base
{ }
class derived2 : public Base
{}
now in my main.cpp I want to be able to create objects of derived1 or derived2 and assign the basePtr to point to them....
how do I do that???
.....
...
derived1 d1
Base::basePtr[1] = &d1 // I tried this approach, the problem is...does this mean I have to have 10 different classes of d1 or d2 and then assign each of their references to the basePtr ??? Is there way to do this dynamically so that I do some thing like the following
Base::basePtr[1] = new derived1;
Pls help..
thanks
|
|
|
|
|
Without arguing about the design of these classes, grin, you can do:
<br />
for (int i=0; i<5; i++)<br />
{<br />
Base::basePtr[i] = new derived1;<br />
Base::basePtr[5+i] = new derived2;<br />
}<br />
what could be nicer would be to have the constructor of Base store the pointers itself.
<br />
Base::Base()<br />
{<br />
basePtr[numObjects++] = this;<br />
}<br />
You would have to add a static 'numObjects' counter for this to work, or...
<br />
Base::Base(int pos)<br />
{<br />
basePtr[pos] = this;<br />
}<br />
As long as you don't create 'Base' objects but only derived objects, you can just go and do this :
<br />
for (int i=0; i<5; i++)<br />
{<br />
new derived1;<br />
new derived2;<br />
<br /> OR:
<br />
new derived1[i];<br />
ned derived2[5+i];<br />
}<br />
|
|
|
|
|
oh one important detail I left out is that
my base class is abstract ....
so there will be instantiation of this class inside the main program.
I tried ur method above to have new objects created dynamically and store thier pointer to the array pointer but it doenst seem to be working
I tried
Base::basePtr[1] = new derived1;
this would not work ! I get a link , unresolved external for static Base::basePtr ...etc etc..
do I have to initialize the abstract class that contains the static array somewhere in the main code ??? how do I do that? or is it even possible?
Thanks
|
|
|
|
|
This happens because you don't declare the array itself.
You 'declared' it in the array, but that was only a 'state of purpose', you need to decalre the variable itself.
so, take your .cpp file, and somewhere in the begining write :
Base* Base::basePtr[10];
then it will link.
p.s. - if your base-class is abstract, then it will never be instantiated 'by itself'.
|
|
|
|
|
hi gang
is there anyone tried to add protocol such as netbuei to available installed protocol in win 2k ?
if yes ,give me a clue .
thnx in advance .
|
|
|
|
|
Hello again !
I post this message again for adding more detailes for my problem.
It seems that I've been missunderstood! I want to query directly the device.
The two methods that you recomended are for reading from registry. This information are available only if a driver is already installed. I want to comunicate to he device even if I don't have a driver instaled.
Thank you again
///////////////////////////////////////
// this is the original message posted
////////////////////////////////////
Hello !
My name is Cristi and I have a big big problem.
I want to get the plug and play informations from a printer connected via parallel port (or usb). Using DeviceIoControl with IOCTL__PAR_QUERY_DEVICE_ID is great in Windows 2000 or XP, but on Windows 95,98 and Me it doesn't work at all. I tried defining myself this IOCTLs with CTL_CODE macro but in vain.
I need to query directly the device and not the driver.
Please, if anyone knows, tell me how can I obtain the plug and play information on an operating system like Windows 95, 98 or ME
You can write me at funnycreeps@go.ro
Thank you !
|
|
|
|
|
I have an application that allows the user to make their own query by selecting fields and then viewing the results. As anyone who's seen my frustrated questions lately would know I've made a DLL to export these results to a .DBF file (the query is done on a MySQL database). This is my question: Should I actually export what they see in their results, or should I export the newest results? The dilemma occurs because the user may make a query with 100 records returned. However this being a large system, if they keep that screen up for a few seconds, something different might be input into the system which might make their query now return 101 records. Either way is easy to implement, I'm just looking for advice on which strategy I should use. Any help is greatly appreciated. Thanks!
If it's broken, I probably did it
bdiamond
|
|
|
|
|
bdiamond wrote:
Should I actually export what they see in their results, or should I export the newest results?
You could always make it an option. If the user is satisfied with the results that were returned, they might not want to bother with a requery.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
I also thought about that and was wondering. thanks!
If it's broken, I probably did it
bdiamond
|
|
|
|
|
Perhaps you can give more background on what exactly is going to be done with these results...
What you're describing is a classic question of :
Is the user suppose to get a snapshot, or is he suppose to be able to view up-to-date resutls all the time.
The first one makes it easy for you, get the results, save them to disk, and you're done.
It's hard for me to understnad how you want to achive 'always up-to-date' with saving data to a file anyways ?
cheers
|
|
|
|
|
My $.02:
In this day of GUI/WYSIWYG, you should save what is displayed to the user. They have to be satisfied with the display in order to save it to disk, and should not be suprised when they open the DBF and see something different.
onwards and upwards...
|
|
|
|
|
thanks!
If it's broken, I probably did it
bdiamond
|
|
|
|
|
I have to develop an application which can be use in several langages.
I show this sample on the site http://www.codeproject.com/cpp/mult_lang_support.asp[^] but it is very hard to convert this exemple for eVC.
Is there someone who can help me please.
Thank you
Sorry for my poor English
|
|
|
|
|
Why not use the baisc support VC has for this ?
Which is declaring all your strings as resources, each with it's different language-ID, and then compiling the application (or resource-dll) with the specific language-flag ?
|
|
|
|
|
Thanks for your reaply
I don't understand own to use it.
My soft have to be internationalised.
I heard about dll, but I don't understand how to use whem.
Thank you for your help.
|
|
|
|
|
You should work with the win32 string resources.
Once your application uses the resource strings, you can start creating duplicate entries in your string table, but for different languages.
Open up one of your string-tables in the resource editor and you will see that you can choose a language for it.
simply take the string-table you have created, right-click it and select 'insert copy', then for this copy change the language.
now you need to go over your duplicated string-table and translate everything to the language you chose.
now, in order to compile your application (as an EXE, not DLL at this moment), simply go to the .rc file's properties inside VC, and either choose the language you want from the menu, or add the appropriate preprocessor definition so that the .rc file takes the strings of the chosen language only.
this way you get a localized EXE.
|
|
|
|
|
Hi,
I am working on application which uses blowfish crypting algorithm. I would like to do application which doesn't just create the encoded file, but which create the .exe file with encoded file inside, that it can later decrypt itself after pluging in a password. Thanks.
I appreciate all links or advice.
Vojtech Havir
|
|
|
|
|
I'm interested, what would you use this for?
Ant.
|
|
|
|
|
|
Maybe so, the only reason I can think of is masking a trojan while writing a dropper program! Whichever way it sounds sinister to me!
Ant.
|
|
|
|