|
if /SUBSYSTEM is console, that is console application, by default system provides a console, i am not sure whether it can be disabled, In linux, for console applications, console is not visible until an console IO statement is executed.
In your sample, main() is not going to execute in (/SUBSYSTEM:WINDOWS) and WinMain is not going to execute in (/SUBSYSTEM:CONSOLE).
However since in (/SUBSYSTEM:WINDOWS) application, since u r not creating any windows, it seems the application is hidden.
1)If you want any user interface and want to hide whenever possible, go for windows application and use ShowWindow() API to hide.
If you never want to have an user interface in this application,
2) still u can use windows application with no window created or
3) go for "Windows Service Application", Windows Service application is usually meant for background and long run task.
|
|
|
|
|
Ok. understand now. So, since i dont want any windows interface for this application, I would like to choose either option 2 or 3. (Use windows application with no window created or go for windows service application"
Let say if i choose option 2. How can i create windows application without affecting my network application (client/server) which has been coded in C. Must i use MFC or there are other options which is much more easier to use to create windows application and it can also integrate my client/server application in C.
If i choose option 3, does windows service application accepts C as the programming platform? Can it be coded in Microsoft Visual Studio or it uses another programming application. Another thing, must i change the whole code of my client/server or i can use the previous one, just change the platform from visual studio to windows service application. Actually im kinda new to programming so im weak in choosing the requirements.
Lastly, thank you from your previous reply and it really helps. Thanks again
|
|
|
|
|
First of all, it seems you need to be familiar with basics of windows programming, that can answer almost everything yourself in this context.
Kogee San wrote: Must i use MFC or there are ...
since u don't need UI, u can avoid MFC for now. Infact u can integrate your C Code with both MFC and WIN32.
Kogee San wrote: If i choose option 3, ...
WIN32, Win Service application can be implemented in VC, VC is C + Microsoft specifics
there should be more than these 3 option to do this, it depends on the level of expertise in windows programming i can rate myself (1/10)
|
|
|
|
|
Kogee San wrote: Im not sure what does this code do...
If the code snippet is troubling you, it's obvious you need to start with the very basics, and leave window hiding for another time.
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Hi,
I have a program where I need to check whether 10s has elapsed before setting something to failed.
I have used clock().
Unfortunately, if the real time updates (for whatever reason e.g. I manually change the clock from 10:30 to 11:30), clock() updates too thereby causing my code to flag an error as it thinks more than 10s has elapsed.
Does anyone know of a way that I can check the elapsed time so that any changes to the real time don't affect it?
I hope that made sense!
Thanks in advance.
|
|
|
|
|
|
Thanks, I've just looked that up in the help and that's exactly what I'm after.
Thanks alot!
|
|
|
|
|
Hi ,
I have a CStringList that contains some filepaths, these paths need to be passed into a function:
eg: GetNewXML(LPTSTR PreviewFileArray[],int count)
How can I construct a LPTSTR array from CStringList?
thanks
|
|
|
|
|
Are you sure that you really need LPTSTR (don't you need LPCTSTR)?
As stated, you probably have to copy all the strings.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
[my articles]
|
|
|
|
|
sorry, what do you mean "copy all the strings. "?
can you provide me a code? thanks
|
|
|
|
|
Yes the function prototype implies such copy.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
[my articles]
|
|
|
|
|
however, I can't initialize the array like this:
LPTSTR[] files = new LPTSTR[count];
do you mean copy character by:
LPTSTR a = list.GetAt(0).CopyChars?
|
|
|
|
|
azusakt wrote: LPTSTR[] files = new LPTSTR[count];
change to
LPTSTR* files = new LPTSTR[count];
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
[my articles]
|
|
|
|
|
Or another suggestion (if you can change the function signature): just pass the string array as a constant reference instead.
void GetNewXML(const CStringList& myList);
You wrote the GetNewXML function ?
|
|
|
|
|
sorry that I can't change the interface for function "GetNewXML", coz it has been written by pervious staff.
so I trying to do, but not work
/*
LPTSTR[] files = new LPTSTR[count];
for(int i=0; i< count ; i++)
{
files[i] = bmpList.GetAt(i).GetBuffer();
}
*/
|
|
|
|
|
Well, in principle, you can do the really weird thing you suggested:
LPTSTR* files = new LPTSTR[count];
for(int i=0; i< count ; i++)
{
files[i] = bmpList.GetAt(i).GetBuffer();
}
GetNewXML(files, count);
for(int i=0; i< count ; i++)
{
files[i] = bmpList.GetAt(i).ReleaseBuffer();
}
delete [] files;
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
[my articles]
|
|
|
|
|
I think you didn't really understand what the function accept: the function doesn't accept an array of strings, but one single string (and the count argument is the size of this string). So, you need to pass each string separately. Basically, what you'll need to do is loop through your string array, create a LPTSTR array of the size of the string and pass it to your function, then delete it.
That's completely stupid because if your previous team would have been smart enough so that they passed the string as a constant (LPCTSTR instead of a LPTSTR), then you wouldn't have to create a new string buffer, copy the string in it, pass it to the function and delete it. You would just have to pass the CString object (and it would have been automatically converted).
Oops, I forgot the [] after the first argument . So, forget what I said...
|
|
|
|
|
What a mess a pair of brackets can do...
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
[my articles]
|
|
|
|
|
Hello Friends,
I need to know how to check weather a push button is enabled or disabled in Win32 API ?
|
|
|
|
|
|
Hi Thanks for the reply. i got the solution.
|
|
|
|
|
about this article: http://www.codeproject.com/KB/system/inject2exe.aspx[^]
can i resize the code section of a PE file?
for example: i want to add 100 bytes(fill with 0x90) end of the code section.
i change values of "SizeOfRawData" and "VirtualSize" for Code Section header. and i change values of "PointerToRawData" and "VirtualAddress" for next sections.
but the new PE file don't execute.
Zo.Naderi-Iran
|
|
|
|
|
I would think you're more likely to get an answer by posting on the message board of that article.
For anyone here to answer, they'd have to know all about it, or download it and research it. The first is unlikely, the next is near impossible.
Good luck,
Iain.
Iain Clarke appearing by Special Request of CPallini.
|
|
|
|
|
But i have expedience for my work ...
Zo.Naderi-Iran
|
|
|
|
|
Hi Iain,
I'm happy you're still appearing by my Special Request.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
[my articles]
|
|
|
|