|
extus wrote: i! Does anyone know how can i make my application starts when windows starts up, i mean using code not put the application in the startup folder!. I think i must use the registry but i m not sure! Thanks!
extus wrote: i! Does anyone know how can i make my application starts when windows starts up, i mean using code not put the application in the startup folder!. I think i must use the registry but i m not sure! Thanks!
In continuation With Giorgi:-
there are two more place from where you can start your application at window startup:-
#1 already told bu Giorgi
#2 HKEY_CURRENT_USER
code:- (just One change to Giorgi code)
CRegKey key;
LONG status = key.Open(HKEY_CURRENT_USER,"Software\\Microsoft\\Windows\\CurrentVersion\\Run");
if(status==ERROR_SUCCESS)
{
key.SetValue("Path of your program","Name of your program");
}
key.Close();
#3 Make entry in %windir%\startup
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
Hello everyone!
I want to debug my program, but When start the program need one
parameter, where can I input the parameter in VC7, please help
me!
Thank you very much!
|
|
|
|
|
For debugging purpose you can take variables instedof parameters
Madhu S. Kapoor
|
|
|
|
|
Right click on the project in Solution Explorer, click on Properties. Expand the treeview on the left and go to Configuration Properties->Debugging. Click on it and you'll find a textbox for entering "Command Arguments".
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
Thank you for your reply.
But in my program it doesn't work. I donn't know the reason.
if I run my program in command line as this: "XXXD.exe /Debug "
it run normally. But when I debug it in program,
I fill the debugging's Command :XXXD.exe, and fill the "Command Arguments": /Debug, but it run as : "XXXD.exe"
it seems the "Command Arguments" doesn't work , Perhaps there is
something I should to set ?
|
|
|
|
|
what program why not say the detail.
----------------------------
Jerry yu
Chinese
programming fans
|
|
|
|
|
int the function OnDraw(),I want to create a DIB bitmap using the array pData,but I am not successful,Please help me.
//the array containing color information
unsigned char* pData=new unsigned char[768*576];
int y=0, x=0;
for(;y<576;y++)
for(;x<768;x++)
{
pData[x*3+y*768*3]=0;
pData[x*3+1+y*768*3]=0;
pData[x*3+2+y*768*3]=255;
}
//information header
BITMAPINFOHEADER FrameBmi;
FrameBmi.biSize=sizeof(BITMAPINFOHEADER);
FrameBmi.biPlanes=1;
FrameBmi.biCompression=BI_RGB;
FrameBmi.biClrImportant=0;
FrameBmi.biSizeImage=768*576*3;
FrameBmi.biClrUsed=0;
FrameBmi.biBitCount=24;
FrameBmi.biWidth=768;
FrameBmi.biHeight=576;
FrameBmi.biXPelsPerMeter = 0;
FrameBmi.biYPelsPerMeter =0;
//file header
BITMAPFILEHEADER pf;
pf.bfType=0x4d42; //"BM"
pf.bfSize=sizeof(BITMAPFILEHEADER)+sizeof(BITMAPINFOHEADER)+sizeof(char[768*576]);
pf.bfOffBits=sizeof(BITMAPFILEHEADER)+sizeof(BITMAPINFOHEADER);
pf.bfReserved1=0;
pf.bfReserved2=0;
//BITMAPINFOHEADER
LPBITMAPINFO lpbmi=(LPBITMAPINFO)GlobalAlloc(GMEM_FIXED,sizeof(BITMAPINFOHEADER));
ASSERT(lpbmi);
lpbmi->bmiHeader.biSize=FrameBmi.biSize;
lpbmi->bmiHeader.biPlanes=FrameBmi.biPlanes;
lpbmi->bmiHeader.biCompression=FrameBmi.biCompression;
lpbmi->bmiHeader.biClrImportant=FrameBmi.biClrImportant;
lpbmi->bmiHeader.biSizeImage=FrameBmi.biSizeImage;
lpbmi->bmiHeader.biClrUsed=FrameBmi.biClrUsed;
lpbmi->bmiHeader.biBitCount=FrameBmi.biBitCount;
lpbmi->bmiHeader.biWidth=FrameBmi.biWidth;
lpbmi->bmiHeader.biHeight=FrameBmi.biHeight;
lpbmi->bmiHeader.biXPelsPerMeter=FrameBmi.biXPelsPerMeter;
lpbmi->bmiHeader.biYPelsPerMeter=FrameBmi.biYPelsPerMeter;
lpbmi->bmiColors=NULL;
//创建DIB位图
CBitmap *OldBitmap;
HBITMAP bmp =::CreateDIBitmap((HDC)pDC,&FrameBmi,CBM_INIT,pData,lpbmi, DIB_RGB_COLORS);
ASSERT(bmp);
//
CBitmap bitmap;
bitmap.Attach(bmp);
CDC dcComp;
dcComp.CreateCompatibleDC(pDC);
OldBitmap=dcComp.SelectObject(&bitmap);
BITMAP bm;
bitmap.GetObject(sizeof(BITMAP),&bm);
// draw bitmap
pDC->BitBlt(0,0,768,576,&dcComp,0,0,SRCCOPY);
dcComp.SelectObject(OldBitmap);
delete [] pData;
GlobalFree(lpbmi);
help me!
|
|
|
|
|
I just got a lil confussed here.
I want to access a variable using the object of the class.
classXYZ objectname= new classXYZ();<br />
objectname.variablename=100;
so which access specifier is best for variablename.
Thanks.
|
|
|
|
|
If that code is outside classXYZ, you have no choice, it must be declared public.
Regards
Senthil
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
public : Accessible outside the class.
protected : Accessible to instances of the class, and to any classes derived from it.
private : Accessible only by the class itself.
Software Zen: delete this;
|
|
|
|
|
karmendra_js wrote:
I want to access a variable using the object of the class.
Accessing Class Variable outside class is not part of Good design.. always create Get and put function to access variable outside the class.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
I am writing a dilaogue based application where a memory bitmap is created and the OnPaint method does a BitBlt to the dialogue.
I can get it to work by doing an initial BitBlt at the end of the OnCreateBmp() method but I would rather trigger OnPaint() so there is no duplicate code. Several attempts at invalidating the client area haven't worked.
Any suggestions?
Elaine
OnCreateBmp()
{
...
pDC = this->GetDC();
m_MemBmp.CreateCompatibleBitmap(pDC,
m_ClientRect.Width(),
m_ClientRect.Width());
m_MemDC.SetTextColor(0xff00);
m_MemDC.TextOutA(33, 33, "Hello world");
}
bmp1Dlg::OnPaint()
{
...
pDC->BitBlt(m_ClientRect.left, m_ClientRect.top,
m_ClientRect.Width(),m_ClientRect.Height() ,&m_MemDC,0,0,SRCCOPY);
CDialog::OnPaint();
...
}
The tigress is here
|
|
|
|
|
call invalidaterect at then end of the OnCreateBmp
-prakash
|
|
|
|
|
That was my first attempt as the last line in OnCreateBitmap:
InvalidateRect(m_ClientRect, TRUE); but it makes no difference.
The tigress is here
|
|
|
|
|
try InvalidateRect(NULL, TRUE);
-prakash
|
|
|
|
|
From where does OnCreateBmp get called? Maybe it's called before GetClientRect can actually get the size of the client rectangle?
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
OnCreateBmp is a button event and m_ClientRect is set up within OnCreateBmp.
As I said if I put a copy of the BitBlt at the end of OnCreateBmp everything is fine, I am simply trying to get the OnPaint to happen and avoid duplicating code.
The tigress is here
|
|
|
|
|
Are you pumping your message queue? For the invalidate to work, the message queue must be pumped which will result in the delivery of the WM_PAINT message.
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|
This would explain what is happening, could you explain in a little more detail please?
Elaine
The tigress is here
|
|
|
|
|
I guess InvalidateRect posts the wm_paint message and the message is pumped by the mfc framework.
-prakash
|
|
|
|
|
Just curious, but what is being drawn in OnPaint()?
The problem is I see you creating a compaltible bitmap, but I do not see you selecting that bitmap into m_MemDC (before drawing to m_MemDC). If that is the case, then you are not drawing on the compatible bitmap. You would be drawing on the default bitmap which is monochrome, supporting black and white only.
INTP
Every thing is relative...
|
|
|
|
|
hello everyone,
i have a simple inheritence question for anybody knows...
let's take an example. I have the following class definition :
class CVCalcParserException {
protected:
int m_iExceptionNumber;
std::string m_strExceptionMsg;
int m_iErrorPos;
public:
CVCalcParserException(int iExceptionNumber,
const std::string& strExceptionMsg,
int iErrorPos);
virtual ~CVCalcParserException();
int GetExceptionNumber();
std::string GetMessage();
int GetErrorPos();
};
In the current state of my class, people could be able to create an instance of it, but I'd like to forbbid this as CVCalcParserException .is supposed to provide some services to the derived classes.
How could i set this class abstract ? the getter functions are not to be overloaded so i cannot put them as pure virtual functions (using =0).
any idea ?
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
Declare the constructor as protected.
class CVCalcParserException {
...
protected:
CVCalcParserException(int iExceptionNumber,
const std::string& strExceptionMsg,
int iErrorPos);
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
S. Senthil Kumar wrote: Declare the constructor as protected
hum, yeah, i thought to this, but wasn't sure...
thank you
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
tell me one more thing, i explicitely define only one constructor with parameters, so, the compiler implicitely defines a default constructor without parameters.
should i also explicitely define this constructor protected ?
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|