|
azi_games wrote:
my program reads the command and does the wash automatically
Yes, this is easy and commonly done. You can store parameters for program in INI file, in Registry, or even read them for command line - see XGetopt for an example of reading command line.
azi_games wrote:
without opening the actual program
I do not understand what you mean. If the user clicks on a program, he expects to see something happen. If nothing happens, he will probably click again. After three or four times, he will probably think your progam doesn't work, and will delete it from system.
Of course, if this is really what you want to do, then there are ways to make a program invisible - e.g., on NT, make it a service. Or make your program's main window the child of an invisible window - it will not even show in the taskbar.
Best wishes,
Hans
|
|
|
|
|
I mean that the program does something without opening up the window.
I have found some information about this but it still is not clear to me.
BOOL CMyApp::InitInstance()
{
LPSTR lpszCmd=GetCommandLine();
// parse lpszCmd
if(command_line_keys_detected)
{
// do all your tasks here
return FALSE;
}
//
// original body of InitInstance
// goes here
//
}
I'm getting command_line_keys_detected error: undeclared identifier.
I don't know how this is supposed to be declared.
Thanks.
|
|
|
|
|
It's a variable. It needs to be declared just like any other.
|
|
|
|
|
Hi,
I have two CTime objects.
I need to determine how many days separate the two dates these objetcs represent.
How could I do this?
Thanks!
-- narada
|
|
|
|
|
Create a CTimeSpan var and initialize it with the difference between the two times. After that, use GetDays in the CTimeSpan object.
|
|
|
|
|
Yes, thanks a lot!
that's what I needed!
|
|
|
|
|
I've been doing some work with IShellFolder and related shell interfaces, working mostly with PIDLs. I did some tests, and saw that the DWORD cast of a PIDL was the same for particular folders. My gut tells me that these pointers are calculated using each folder's ID, token if you will. Does anyone who has more experience with these know for sure if they are persistent for each folder/file/virtual folder in the Namespace?
|
|
|
|
|
Hi there
I'm trying to refactor some old code, and in the process I'm introducing a dll, that's to be used from atleast 5 app's. The exe's has som objects with operations on them that i want to call. And I run into troubles. And I cannot figure out how to make a funktion call from an mfc extension dll to an exe.
Please hint me.
thanks
kenneth
app,dll,exe,call
|
|
|
|
|
How about passing the DLL a pointer to a static or global function from the main process?
Kuphryn
|
|
|
|
|
well, i'm just not happy with globals, but it might be the only way.
I was hoping on something like an COM emulated solution, through interfaces or
just through instances.
k
|
|
|
|
|
Just wondering if you are are exporting the function/methods (and or the objects) from the .exe.
Trust in the code Luke. Yea right!
|
|
|
|
|
Hello,
I am new to MFC, please bear with me.
Within MainFrm.cpp, I have a function that is mapped as
ON_COMMAND(ID_STARTUP, DoStartupFunctions)
Now, I want to execute this before user can do anything else. Can you guide me on this ? Thanks.
Robert
|
|
|
|
|
Go to class wizard ( CTRL + W) and map a function to the message WM_INIT
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
Depending on what things you want to happen initially, you may need to put code in several classes, not just CMainFrame.
|
|
|
|
|
Normally the applications get initialized in the OnInitInstance handler.
Well after having said that, think always in the OOP and initialize class members inside it's own owner class (this will make your life easier).
And after having said this and going where you need to go..., I think there's a handler for OnInitialUpdate (If you want to initialize things after the view is created) OnCreate (if you want to initialize things while the view is created). Take a look at the class wizard as other CPian advice's you Ctrl+W and choose the best handler for your pourpose.
Hope this helps...
|
|
|
|
|
In your app's InitInstance() method, right after you create the mainframe window, do:
pMainFrameWnd->PostMessage (WM_COMMAND, ID_STARTUP);
This will cause the DoStartupFunctions() handler to be called before the user is permitted to interact with the app.
/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
Thank you, all. I got it. Wished I had asked before
Robert
|
|
|
|
|
Hi,
I'm looking for an Edit box where i can set the font size something bigger. Do somebody know such of control??
Thanks,
Willem
|
|
|
|
|
Yes, the Edit control is what you want. Just select a different font into its DC.
|
|
|
|
|
DavidCrow wrote:
Yes, the Edit control is what you want. Just select a different font into its DC.
okay, but how can i do that?
thank you!
|
|
|
|
|
Use SetFont() , which is a method of the base CWnd class. See the documentation of CFont before using this function.
/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
By using SetFont():
BOOL CMyDlg::OnInitDialog()<br />
{<br />
CDialog::OnInitDialog();<br />
<br />
m_font.CreateStockObject(SYSTEM_FIXED_FONT);<br />
m_edit1.SetFont(&m_font);<br />
<br />
return TRUE;<br />
}
|
|
|
|
|
create a font, and set the edit control to use it. The font object should be a member var in your dlg class.
Method 1:
---------
OnInitDialog()
{
...
m_oFont.CreatePointFont(80,"MS Sans serif");
m_oEditControl.SetFont(&m_oFont);
...
}
Method 2:
---------
static LOGFONT BASED_CODE sEditFont =
{ -10, 0, 0, 0, FW_BOLD, 0, 0, 0, 0, OUT_STRING_PRECIS, CLIP_STROKE_PRECIS,
DEFAULT_QUALITY, VARIABLE_PITCH|FF_SWISS, "Arial"};
OnInitDialog()
{
...
m_oFont.CreateFontIndirect(&sEditFont);
m_oEditControl.SetFont(&m_oFont);
...
}
|
|
|
|
|
|
There are a bunch of utilities here (like grids) that I would like to try out from VB.NET. Microsoft says that they have made it pretty easy but I have not seen any examples of how to do it. Anyone with experience at this?
|
|
|
|