|
No, but I do have a web page. I need to include "Download" capabilities for it but I don't have a clue as to how. I was hoping someone out there knew of a tutorial or something to show me how.
A C++ programming language novice, but striving to learn
|
|
|
|
|
Hi,
I have created a win console application. When I run this application ..it just runs and disappears. If i use getch() before main return, then it waits for a key press. That is only when we press a key application closes.
So now I don’t want to use getch(). Is there any other way to hold the application, so that will not just disappear.
Thanks
Nandu
|
|
|
|
|
Several options here.
1. Open a command window first, then run your program from there.
2. Right-click on your executable and look at properties. Click on the Program tab, and clear the checkbox that says "Close on Exit".
3. If you have a shortcut (on the desktop for instance) do step 2 to the shortcut.
Hope that helps.
Karl - WK5M
PP-ASEL-IA (N43CS)
PGP Key: 0xDB02E193
PGP Key Fingerprint: 8F06 5A2E 2735 892B 821C 871A 0411 94EA DB02 E193
|
|
|
|
|
Hi,
I have tried the above points,
1. but still the window closes.
2. Right clicl on the exe dose not have an program tab or "close on exit" option as well.
So please suggest if there is any other option avilable.
Thanks
Nandu
|
|
|
|
|
Since you didn't indicate your operating system, I guess that could be the difference.
I'm using Windows XP (SP3) and I get the Program tab and on that tab there is a Close on exit checkbox.
If I could figure out how to attach an image, I'd put that in this message.
Karl - WK5M
PP-ASEL-IA (N43CS)
PGP Key: 0xDB02E193
PGP Key Fingerprint: 8F06 5A2E 2735 892B 821C 871A 0411 94EA DB02 E193
|
|
|
|
|
You could try adding system("Pause") at the end of your program.
-Saurabh
|
|
|
|
|
Hi,
system("Pause") is working fine.
But I have a doubt, using system ("Pause")is similar like using getch(). In what way these two differs and which is the best option.
For the same question, some people suggest to use batch file to run the command line exe. But to use batch file we have a problem. This is because while executing command line exe...user also needs to provide some arguments as he needed. So if we use batch file user will not be able to provide the argument as need...he has to edit the batch each time he need to run the exe with different arguments.
So is there any way where user can give the arguments using batch file (rather than editing the batch file).
For now we have 3 options
1) Using getch() -- this is not the right approach
2) system ("pause") -- is this approach is right one?
3) If batch file is correct option -- how to address the batch file problem
Thanks
Nandu
|
|
|
|
|
You can pass command line arguments to batch files. Google about it and you can find lots of tutorial on how to use batch files.
I am not sure what exactly is your confusion and why are you worrying so much on such a simple issue. What do you mean by is system("pause") a correct approach? Can you define correct? Typically, correct is one that meets the requirements. What is the requirement in your case?
The main difference between 1 and 2 is for getch user will have to press a key then press enter to quit the application. system("pause") on the other hand needs just any key press to quit the application.
-Saurabh
modified on Saturday, July 5, 2008 3:26 AM
|
|
|
|
|
A single document project, view class inheritance from CFromView. In view from, have many controls, edit control, static control...
When screen resolution changed or project runing from 16 by 10 screen to 4 by 3 screen, controls not printed right what printed right in 16 by 10 screen.
I can use
GetSystemMetrics(SM_CXFULLSCREEN) and GetSystemMetrics(SM_CYFULLSCREEN) to get screen resolution and then make controls size
to fix to current screen,but controls are to many in from. I want to make all controls by simple way.
|
|
|
|
|
double xRatio = GetSystemMetrics(SM_CXSCREEN) / 800.00;
double yRatio = GetSystemMetrics(SM_CYSCREEN) / 600.00;
rect.left = long((rect.left/1.28)*xRatio);
rect.top = long((rect.top/1.28)*yRatio);
rect.bottom = long((rect.bottom/1.28)*yRatio);
rect.right = long((rect.right/1.28)*xRatio);
Nigah M Manzoor
|
|
|
|
|
i derived propertysheet in that i want to hide some buttons
my code is like this
CButton* m_ApplyButton;
CNSPropertySheet* pSheet = dynamic_cast < CNSPropertySheet*>(GetParent());
ASSERT(pSheet);
m_ApplyButton = reinterpret_cast<CButton *>(GetDlgItem(IDC_FORM_APPLY));
pSheet->GetDlgItem(IDC_FORM_APPLY)->ShowWindow(FALSE);
but i am not getting handler in m_ApplyButton
how to get that handler
|
|
|
|
|
It's been a while for me messing around with property sheets, but the easiest way to hide the apply button would be applying the "PSH_NOAPPLYNOW" attribute.
Anyway I think you are using the wrong Control ID. I think it should be IDAPPLY or something like IDC_APPLY.
see http://msdn.microsoft.com/en-us/library/bb774538(VS.85).aspx?info=EXLINK[^]
some code from one of my ctor's for PSH_NOAPPLYNOW
<br />
m_psh.dwFlags |= PSH_NOAPPLYNOW; <br />
m_psh.dwFlags &= ~PSH_HASHELP; <br />
m_dlgOptionsUsers.m_psp.dwFlags &= ~PSH_WIZARD;<br />
m_dlgOptionsSMB.m_psp.dwFlags &= ~PSH_WIZARD;<br />
So long,
Stefan
|
|
|
|
|
HI All,
Im new to MFC. I need to use Mschart in VC++.I dont konw how to use in my project.Plz help me.
Thanks & Regards
Anitha
|
|
|
|
|
|
Im using Microsoft Visual Studio 2005. yes, I tried that model. But it showing the error msg "error C2039: 'SetChartData' : is not a member of 'CChart1'". I used the ActiveX control.
Regards,
Anitha
|
|
|
|
|
How to get object or handle of control in its event handler function without using its ID ?
I have created a button "OK" and its handler onOK(), I want to know how i wll get its handle or object inside onOK() function. I dont want to use its ID like getdlgItem(ID_OK)..
onOK()
{
CButton *obj = ? ;
}
If any body have solution please reply
Chetan m.p.
chetan.official@gmail.com
|
|
|
|
|
Create a CButton control variable in the class.
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
thank u
my project having 6 forms with 30 edit box on each,i dont want to make memeber variables for each forms.
I made one class inherited in all forms ,and having one function fnOnchange() & i wana to call these generalise function call on each onchange of buttons
CGeneralize
{
public:
fnonchange()
{
// get handle of cntrl
....
cntrl->getWindowtext(str);
.....
}
}
CForm1:public CGeneralize
{
onOK()
{
fnonchange();
}
.
.
//similarly for all 30 buttons .
.
.
}
.
.
.
//similarly for all 6 forms
Suggest me another solution
Chetan m.p.
Soft.Engg.
|
|
|
|
|
See if I got this right:
1. You don't want to create member variables
2. You don't want to use GetDlgItem
3. You want to get a CWnd pointer, or handle, to the control in your message handler
4. You are using MFC
There's no solution that satisfies those requirements.
Find something else to do.
...and you actually have 6 forms with 30(!) edit boxes....
For what it's worth...
if I ever had to do such a monster I would create a container that would hold all those control variables, e.g. a map that maps the ID of the control to the CEdit instance. I would also use ON_CONTROL_RANGE so I wouldn't have to write a message handler for each control.
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
|
I am using two third party com dll . I am facing the problem that their clsids are same ,so i can
use only one dll. but my project requirement is to use both the dll . Is their any way to
change the clsid of the com dll . any binay tool etc. any another trick.
Rajesh
|
|
|
|
|
rajeshgupta1253 wrote: clsids are same
Is it the name that's the same or the GUIDs(it can't be)?
ATL COM DLLs come with namespaces if you have the tlb file associated with them, namespaces does help avoid such cases.
Then there is a rename attribute that can be used with a tlb file while using #import .
From MSDN:
The rename attribute is used to work around name collision problems. If this attribute is specified, the compiler replaces all occurrences of OldName in a type library with the user-supplied NewName in the resulting header files.
Nibu babu thomas
Microsoft MVP for VC++
Code must be written to be read, not by the compiler, but by another human being.
Programming Blog: http://nibuthomas.wordpress.com
|
|
|
|
|
|
This is supposed to be a no-no....
If the two servers have the same class id, then it is the same server, by definition and by COM spec. It may be that the later server is an updated version, but it is still the same server.
If the supplier of the two servers claims that those are two different servers, they have broken some of the fundamental rules of COM and there are no guarantees for this to work when distributed even if you might get it to work on your machine.
The human readable ProgID may be updated with a new version from e.g. <Company>.<Server>.1 to <Company>.<Server>.2, then they also have to give the server a new class id.
If the supplier of the two servers confirms that this is the same server, then your project requirements are wrong or misinterpreted since this is not how the COM architecture works.
It may give a hint if you compare the ProgIDs.
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
I guess the coders had a sample project and had written some code but not changed the CLSIDs.
Greetings from Germany
|
|
|
|