|
Hi,
i would like to know if it is possible to open the (graphics) control panel from a c++ application ?
I couldn't find any information about this, i found a lot on creating control panel applets, but nothing on just poping-up the control panel onto the screen.
Thanks in advance,
Lion
|
|
|
|
|
Launch (with your favorite function --CreateProcess , ShellExecute , etc.) the program control.exe . This works at least in Windows 95 (not tried in other OSs).
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Thanks, it is nearly that, but my expression skills are so poor......
In fact, i wanted to open the "display settings" control panel.
I guess that it is about the same method than the one you explained here, but with a little modification to tell the system wich element of the control panel i wanna open (in my case, the "display settings" element).
Anyway, thanks, i have at least a direction to look at now.
Lion.
|
|
|
|
|
Well.. i use CHtmlView for my program.. it doesnt give any compile error.. but after i run it and start to browse a page or at least tiggering for browsing, i decided to close the child window or the program ana gives this error :
Unhandled exception at 0x5d1f65a4 (mfc70d.dll) in MdiTabWnd.exe: 0xC0000005: Access violation reading location 0xfeeefeee.
=> BREAK
// objore.cpp
BOOL CObject::IsKindOf(const CRuntimeClass* pClass) const
{
ASSERT(this != NULL);
// it better be in valid memory, at least for CObject size
ASSERT(AfxIsValidAddress(this, sizeof(CObject)));
// simple SI case
CRuntimeClass* pClassThis = GetRuntimeClass();
return pClassThis->IsDerivedFrom(pClass);
}
How can i prevent it? What would be the error??
Thanks A Lot...
At least reading my post....
|
|
|
|
|
hi...I set up a progressbar in a simple dialogbox which I created in the resource editor of vc++.
When I want to open the dialog via the DialogBox Function nothing happens, but If I remove the progressbar from that dialog, the dialog shows up properly (without that bar).
I tried to create a childwindow (class : PROGRESS_BAR), but it seems, that this is not possible. Does anybody know, what could be the problem here?
.thanks in advance
|
|
|
|
|
You're not using MFC ? How are you showing the dialog ? Have you tried calling the progress bar something else ( possible collision ) ?
Christian
I have come to clean zee pooollll. - Michael Martin Dec 30, 2001
Picture the daffodil. And while you do that, I'll be over here going through your stuff.
|
|
|
|
|
no I am not using MFC...I created a dialog resource in the VC resource editor, which produced some IDD_DIALOG1 number...I use that number to make a call to
DialogBox(hInstance, IDD_DILOG1 , hWndParent, lpDialogFunc).
Internaly there might be used MFC.
However, the progressbar control within this IDD_DIALOG1 has some
ID too, but I have no idea, of how to call this progressbar else.
About which type of collision are you talking?
|
|
|
|
|
skydave wrote:
However, the progressbar control within this IDD_DIALOG1 has some
ID too, but I have no idea, of how to call this progressbar else.
By right clicking on it and choosing properties. It's probably called 'progress 1' or something.
skydave wrote:
About which type of collision are you talking?
I thought if you had a progress with the same ID as the dialog that might cause it to fail. You may have called the dialog IDD_PROGRESS1 because it was going to have a progress bar in it, or something.
Have you tried calling GetLastError ( or showing it in the debug window during a trace ) to get some idea what is going on ?
Christian
I have come to clean zee pooollll. - Michael Martin Dec 30, 2001
Picture the daffodil. And while you do that, I'll be over here going through your stuff.
|
|
|
|
|
getlasterror returns the error code 1400 which means, that there had been an invalid windowhandle. I guessed, that the third parameter
of the DialogBox function is meant...I passed along the NULL pointer, since I thought there is no parent window needed.
But passing along a window like that one retreived from GetDesktopWindow() doesnt solve the problem...the lasterror is 1400 again.
Any idea what windowhandle could be meant?
There is no collision, since the DialogBox has some other ID then the
Progressbar.
|
|
|
|
|
|
ok that did the trick. Thank you very much.
|
|
|
|
|
A lot of people forget to do that when they use progess bars and sliders in non-MFC projects
Nish
Nish was here, now Nish has gone;
He left his soul, to turn you on;
Those who knew Nish, knew him well;
Those who didn't, can go to hell.
I like to on the Code Project
Sonork ID 100.9786 voidmain
www.busterboy.org
|
|
|
|
|
i asked this question before but i did not any clear answers
Q: how do i use command arguments in VC++6.0?
A: Depending on which arguement that you are trying to use, you can set the command line parameter in the Project | settings menu option.
You can either select the different tabs in order to get a form to customize the command line, or you can directly edit the command line arguements in the edit box at the bottom of most of the tabs.
please write me if you think you can give me some instructions on how to set my vc++ to read command lines!
thank you
|
|
|
|
|
Do you want your application to read the command line ?
If so, the global variable __argc will tell you how many arguments there are. The items in the array __argv[] will point to strings containing each of the arguments. __argv[0] will contain the name of your application. You can iterate through __argv[] to obtain each argument.
In a console app you can do this :
<br />
<br />
for( int i=0; i < __argc; i++ )<br />
fprintf( stdout, "arg %d is '%s'\n", __argv[i] );<br />
<br />
|
|
|
|
|
From the answers he's got I assume no one actually understood his requirement. You and Atul think he wants to parse command line arguments. Hockey thinnks he wants to use VC++ from the comman line.
I think he actually wants to pass an argument to his program when running it from within VC. If so that can also be done. But the whole point is no one knows what he wants.
Nish
Nish was here, now Nish has gone;
He left his soul, to turn you on;
Those who knew Nish, knew him well;
Those who didn't, can go to hell.
I like to on the Code Project
Sonork ID 100.9786 voidmain
www.busterboy.org
|
|
|
|
|
You could be right. He was a bit less than clear in his question.
|
|
|
|
|
Here I try this
from command line
msdev.com /?
Usage:
MSDEV [myprj.dsp|mywksp.dsw] - load project/workspace
[<filename>] - load source file
/? - display usage information
/EX <macroname> - execute a VBScript macro
/OUT <filename> - redirect command line output to a file
/USEENV - ignore tools.options.directories settings
/MAKE [<target>] [...] - build specified target(s)
[<project> - <platform> <configname>]
[[<project>|ALL] - [DEBUG|RELEASE|ALL]]
/CLEAN - delete intermediate files but don't build
/REBUILD - clean and build
/NORECURSE - don't build dependent projects
I think this is what yer after
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
Is this what you are looking for ?
#include < iostream >
using std::cout;
using std::endl;
int main(int argc,char *argv[])
{
cout<<"argc = "<<argc<<endl;
for(int cnt=0;cnt < argc;++cnt)
cout<<"argv "<<cnt+1<<" = "<<argv[cnt]<<endl;
return 0;
}
Click Project->Settings..In Settings click Debug.Make sure your project is selected on the left. Go to Program Arguments and type in say "1 2 3" w/o the quotes. See the output.
From MSDN...
argc
An integer specifying how many arguments are passed to the program from the command line. Because the program name is considered an argument, argc is at least 1.
argv
An array of null-terminated strings.The first string (argv[0]) is the program name, and each following string is an argument passed to the program from the command line. The last pointer (argv[argc]) is NULL.
Atul
Sonork ID : 100.13714 netdiva
|
|
|
|
|
i just want someone to tell me what steps to follow to set the vc++ to read command lines.
here are the kind of instructions i want
i mean something like go to menu bar select " this option" then do this then do that
so that compiler know how to read the command lines without having to go to DOS mode.
i hope i made it clear this time.
|
|
|
|
|
That's what I have given
A small piece of code and settings in VC++ IDE to pass cmd line arguments...
Atul
|
|
|
|
|
I took this code directly from Tom Armstrongs book, Designing and Using ActiveX Controls.
I am trying to implement the 1st example. A COM/MFC Edit control. The code is meant to set the background and forground colors of the activex controls to that of its contanier.
The problem is it makes both color sets black. Any suggestions on how the code should be writen?
LRESULT CEEditCtrl::OnOcmCtlColor(WPARAM wParam, LPARAM lParam)
{
if(m_pBackBrush == NULL)
m_pBackBrush = new CBrush(TranslateColor(GetBackColor()));
CDC* pdc = CDC::FromHandle((HDC)wParam);
pdc->SetBkMode(TRANSPARENT);
pdc->SetBkColor(TranslateColor(GetBackColor()));
pdc->SetTextColor(TranslateColor(GetForeColor()));
HBRUSH far* hbr = (HBRUSH far*)m_pBackBrush->GetSafeHandle();
return (DWORD) hbr;
return NULL;
}
thank you
|
|
|
|
|
How can i compare 2 wav files?Can anyone show me or email me some code? (costexx@hotmail.com)I want to know if it's the same sound.
|
|
|
|
|
Do you want to know if they *sound* the same, or *are* a copy of the same file ?
Christian
I have come to clean zee pooollll. - Michael Martin Dec 30, 2001
Picture the daffodil. And while you do that, I'll be over here going through your stuff.
|
|
|
|
|
Two entirely different things eh?
Nish
Nish was here, now Nish has gone;
He left his soul, to turn you on;
Those who knew Nish, knew him well;
Those who didn't, can go to hell.
I like to on the Code Project
Sonork ID 100.9786 voidmain
www.busterboy.org
|
|
|
|
|
Nish [BusterBoy] wrote:
Two entirely different things eh?
Nish you should move to Canada, your half way there already
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|