|
hiii...
i am overwriting the .RC file of a workspace/project with some dialog resources...
obviously wen i am executing the program i cannot see any output.....
how can i display the new dialogs that i have put into the .RC file wen the program is executed ?
for example....i have transferred the 4 dialog boxes of the Calculator (calc.exe) to one of my own VC++ 6.0 application....
regards,
kedar.
|
|
|
|
|
well, you need to CODE them ... add a dialog class, "plug-in" all the controls, add execution code, ... all the works ...
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
hiii...thanks for the info...
but stil can u send me a sample code of what u were tellin to do......or some link wher i can find a similar example.....
it would b a great help to me....
In anticipation,
kedar.
|
|
|
|
|
Hi Everybody,
we are using a cash system printer which is connected to the PC via USB.
The printer has an endless paper roll and also has a paper cut feature.
The printer supports 4 paper sizes:
- "80x210 mm"
- "80x297 mm"
- "reserved48"
- "reserved49"
The first two paper sizes are the maximum sizes.
So the printer cuts a print after 210mm or 297mm.
If you choose "reserved48" in Excel the printout is exactly
as long as needed.
But if I choose this paper size in my own applications
nothing is printed at all. The paper is thrown out about
1 cm and then cut.
I examined a little bit about Device caps but every value seems to be invalid.
The paper size specified in the DEVMODE is 1 pixel by 1 pixel, so not very
much ((
Does anyone know how to handle this?
I really appreciate every hint!
Thanks in advance,
Jens
|
|
|
|
|
Hey...
Ive been making a Program with Microsoft Visual C++ 6.0...
Ive made it so that my Main interface window has buttons, and ive made other CDialog resources but I dont know how to make it so when i click on the Button on the main interface itll open another CDialog window...
How would i do that?
<br />
void CClientDlg::OnButton01() <br />
{ <br />
<br />
} <br />
Just a Human Trying to Live in a Computers World.
|
|
|
|
|
easy...
<font color=#0000FF>void</font> CClientDlg::OnButton01() {
CMyDialog dlg;
dlg.DoModal();
}
I suppose CMyDialog is a CDialog derived object that is associated with your IDD_Dialog1 dialog
... you've got it
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
That Helps So Much! I have one Question tho... Its driving me Crazy...
<br />
void CClientDlg::OnButton01() {<br />
CClientDlg dlg; <br />
dlg.DoModal();<br />
}<br />
Works Perfectly, If i click on Button01, The main interface opens again (Note: So button activates Window)...
But i created a new Dialog, (Class: CButton01Dlg) (CPP: Button01Dlg.cpp) and when i use the following code it gives me 4 errors, 0 warnings...
<br />
void CClientDlg::OnButton01() {<br />
CButton01Dlg dlg; <br />
dlg.DoModal();<br />
}<br />
C:\*\ClientDlg.cpp(179) : error C2065: 'CButton01Dlg' : undeclared identifier
C:\*\ClientDlg.cpp(179) : error C2146: syntax error : missing ';' before identifier 'dlg'
C:\*\ClientDlg.cpp(179) : error C2065: 'dlg' : undeclared identifier
C:\*\ClientDlg.cpp(180) : error C2228: left of '.DoModal' must have class/struct/union type
Just a Human Trying to Live in a Computers World.
|
|
|
|
|
You probably forgot to include the header file of CButton01Dlg (Button01Dlg.h) in ClientDlg.cpp .
|
|
|
|
|
Hahaha... Your Right!!!
Thank you Both So very Much!
This problem has been driving me crazy all day long... Thanks!
Just a Human Trying to Live in a Computers World.
|
|
|
|
|
hum, i'd like to answer, even if you already have the solution...
C:\*\ClientDlg.cpp(179) : error C2065: 'CButton01Dlg' : undeclared identifier
C:\*\ClientDlg.cpp(179) : error C2146: syntax error : missing ';' before identifier 'dlg'
C:\*\ClientDlg.cpp(179) : error C2065: 'dlg' : undeclared identifier
C:\*\ClientDlg.cpp(180) : error C2228: left of '.DoModal' must have class/struct/union type
here is what the compiler says :
first error, undeclared identifier. what does this evoque for you ? for me (and the compiler too), it means that the identifier CButton01Dlg is called in a module (cpp file) but the definition of that identifier is not inside it. You so have to help it telling it that it will find such definition in Button01Dlg.h file (for example).
So, do this :
<font color=#0000FF>#include</font> <font color=#808080>"Button01Dlg.h"</font>
The 3 last error depend on the 1st one. As CButton01Dlg were not defined, the compiler could not do anything with it, so :
- could not declare dlg in a type it doesn't know (error C2065),
- could not use dlg (error C2228).
here it is. hope it will help a bit...
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
Hello,
I'm a VC++ beginner. And things seem to be so hard to me...
I'm stuck with the problem of constructor. Here is my code
//file Point3D.h
....
CPoint3D: public CObject
{
public:
CPoint3D();//default constructor
CPoint3D(float X,float Y,float Z);//my constructor
.....
private:
float x;
float y;
float z;
}
//end of Point3D.h
//file Point3D.cpp
.....
CPoint3D::CPoint3D(){
x=0;
y=0;
z=0;
}
CPoint3D::CPoint3D(float X,float Y,float Z){
x=X;
y=Y;
z=Z;
}
....
//end of file Point3D.cpp
and when I delared an object of CPoint3D in class CPointDoc like the code following:
//file PointDoc.h
...
#include "Point3D.h"
CPointDoc: public CDocument
{
.....
public:
CPoint3D point(1,2,3);
.....
}
//end of file PointDoc.h
I received an error at the line:
CPoint3D point(1,2,3) in file PointDoc.h
like this: syntax error "const"
I've tried to figure out but I failed.
Please, help me over this problem!
Any help would be much appreciated!
Thanks in advance!
Grenouille
|
|
|
|
|
You cannot initialize object inside class declaration. You should do it in costructor, i.e:
class CPointDoc: public CDocument
{
.....
public:
CPoint3D point;
.....
};
...
CPointDoc::CPointDoc ():point(CPoint3D(1,2,3))
{
}
|
|
|
|
|
be careful to construct the base class object too :
CPoint3D::CPoint3D() : CObject() {
}
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
nonsense. The base class constructor is called automatically before CPoint3D's constructors body is executed.
Cheers
Steen.
"To claim that computer games influence children is ridiculous. If Pacman had influenced children born in the 80'ies we would see a lot of youngsters running around in dark rooms eating pills while listening to monotonous music"
|
|
|
|
|
Hello friends,
Please observe the program given below
#include <iostream.h>
class A
{
int a , b ;
public:
A();
A(int,int);
void show();
};
A::A()
{
a = 10;
b = 20;
}
A::A(int x1 , int x2)
{
x1 = a ;
x2 = b;
}
void A::show()
{
cout <<"the value of a" << a << endl;
cout <<"the value of b" << b << endl;
}
int main()
{
A obj1(11,20);
A obj2;
obj2.show();
cin.get();
return 0;
}
My question Can I call "show function" using the object "obj1".I tried to call the show function using the object obj1. I got junk values for a and b in return. Correct output is got when I call "show function" using the object obj2.
Why this is so ?
Please help.
Best Regards,
Phijo
|
|
|
|
|
phijophlip wrote:
I tried to call the show function using the object obj1. I got junk values for a and b in return.
Of course you did. In the constructor A(int x1, int x3) , you assign whatever value may be in your member variables into the parameters. Try switch the assignments
A::A(int x1 , int x2)
{
a = x1;
b = x2;
}
"After all it's just text at the end of the day. - Colin Davies
"For example, when a VB programmer comes to my house, they may say 'does your pool need cleaning, sir ?' " - Christian Graus
|
|
|
|
|
Obj1 is constructed with the constructor that receives two parameters. If you look at this constructor:
A::A(int x1 , int x2)<br />
{<br />
x1 = a ;<br />
x2 = b;<br />
}<br />
I think you made a mistake here. You must not store a in x1 and b in x2 but the opposite !!! So it would become:
A::A(int x1 , int x2)<br />
{<br />
a = x1 ;<br />
b = x2;<br />
}<br />
And that's why you get junk vallues, because the variables a and b are never initialised.
|
|
|
|
|
A::A(int x1 , int x2)
{
x1 = a ;
x2 = b;
}
definately u will get garbage values for a and b.as it doesnot assign values to a and b as previous constructor
|
|
|
|
|
The solution to the problem has already been given, but I'd like to offer that you could have been warned by the compiler had you used the following instead:
A(const int,const int); Now any attempt to modify the parameters passed to the constructor would result in a compiler message.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
i have a handle to a bitmap image using Loadimage(...,LR_FROMFILE).. how do i use it to display the image in a custom static control that i have created by subclassing the static control using bitblt() function.Also i need to use the scrollbars if the image size is greater thn the size of the control... can anyone help!!
sanjay
|
|
|
|
|
For painting the bitmap into your static, use
CPaintDC dc(this);
CDC MemDc;
CRect rcClient;
GetClientRect(&rcClient);
MemDc.CreateCompatibleDC(this->GetDC());
CBitmap* pMemBitmap = MemDc.SelectObject(&m_Bitmap);
if (pMemBitmap)
dc.BitBlt(0, 0, rcClient.right, rcClient.bottom, &MemDc, 0, 0, SRCCOPY);
MemDc.SelectObject(pMemBitmap);
Sorry cant help you with the scrollbar thing... hope this helps.
- tareq
|
|
|
|
|
thanks tareq, i will try this out at night on my pc..
sanjay
|
|
|
|
|
Hi all...
i want some exercises based on MS SQL northwind database for a training program..
can u pls send me any links / pdf /doc
very urgent..please help me...
Thanks in advance
renji
Ninety-eight percent of the thrill comes from knowing that the thing you designed works, and works almost the way you expected it would. If that happens, part of you is in that machine.
|
|
|
|
|
A server program that I have to deal with is slightly old and is not getting any further upgrades. Problem is that if someone tries to login to it using %s, %i, etc... then it crashes and has to be restarted, I am sure you all can figure out why that is. I either need to make a small program to watch for the login packet and drop it when % is detected in the name, since they would not be their anyways. I already have the packet structure and it is uniform for all logins so it would be simple to just do a couple compares of the packet array to see if it needs to be dropped. Does anyone have any thoughts, code, etc for a simple way to achieve dropping a packet with specific data, preferably heading to a specific program?
|
|
|
|
|
if you overload a function with "signed char" instead of just "char" and another with "signed int" then call it with 'c' as a parameter, the "signed int" one gets called, not the "signed char" one. Is this a bug in VC++, or is it supposed to work that way?
|
|
|
|