|
One solution is to add a message handler for the mouse move message in the view class.
Kuphryn
|
|
|
|
|
Thanks,
I'm new to this environment....
So how do I go about that?....
Any help will be most appreciated...
|
|
|
|
|
What are the steps to save the content of the CDC to the Bitmap file?
Well going through the MSDn and web articles i found some of the handy tools that are used for saving the content of Memory device context to bitmap file are:
1.0 Fill the BITMAPHEADERINFO structure
2.0 uSE THE GetDIBits() function
3.0 Use of CreateDIBSection to write
Problem Statement: I am having a global Memory device context. In a function i am initialising it as Mem. DC by calling API -> CreateCompatibleDC().
All the drawing stuff is drawn to it.
Now on Save i have to save the content of the MemoryDevice Context ( MemDC) to a Bitmap file.
Any solution,idea and guidelines to do this.
Leave your mark wherever you go
|
|
|
|
|
codeproject
MFC / C++ >> Bitmaps & Palettes
CxImage
CDibData
A DIBSection wrapper for Win32 and WinCE
etc...
INTP
|
|
|
|
|
Why sometimes when i press . or -> the intellisense will pop-up a menu, but other times it does not. Is there a problem with vc++6? I'm definitely sure that particular object has that member function, but intellisense fails to bring the pop-up menu, all options are enabled btw.
Anyone experienceing same prob like me?
|
|
|
|
|
deleting intellisense database .ncb file helps sometimes VS will built an new and then it should work
|
|
|
|
|
THanks! It works! I deleted .ncb file, and the next thing i know, the intellisense is back!!! Thanks a lot man!
|
|
|
|
|
also, I find that sometimes it doesn't work in a new class or if you're on a line after you've made a syntax error. In new classes, go the .h file and click anywhere within the class definition and hit <enter>. that works for me when intellisense isnt' working or the class isn't showing up in the ClassView window
If it's broken, I probably did it
bdiamond
|
|
|
|
|
It really pisses me off when intellisense occasionally does not work. I'll try deleting .ncb and see if it works then. Thx for the tip
|
|
|
|
|
Hi all,
In my application, i created the property sheet with six property pages.. The property pages are appeared as 2 rows in tab control of the property sheet. I want to display the dialog property pages in a single row. Any one please give me the suggestion to achive this.
Regards,
Prakash
A Journey of thousand miles must begin with a single step.
|
|
|
|
|
I could be wrong on this diagnosis but I think you need to set the style of the tab control so that it doesn't have the TCS_MULTILINE property.
CTabCtrl* pTab = MyPropertySheet.GetTabControl ();
pTab->SetStyle (pTab->GetSylte & ~TCS_MULTILINE); I think that should remove the TCS_MULTILINE style from the tab control.
- Aaron
|
|
|
|
|
Hi,
I got the solution using EnableStackedTabs() method available in CPropertySheet class
Regards
Prakash
A Journey of thousand miles must begin with a single step.
|
|
|
|
|
Hello palls,
I am a C beginner and sti have some probems with memory allocating.
I know how to do it with a 1 dimension array but it doesn't work with a 2 dimension one, and please, how about to free them
|
|
|
|
|
Here is one solution.
char **pArray = new char *[1];
pArray[0] = new char [32];
...
delete [] pArray[0];
delete pArray;
Kuphryn
|
|
|
|
|
please do not forget that delete [] pArray[0]; did not free all memory because some time it does not know how long is the array. if you want to be shure that all memory are free you have to free memory like:
for(int i = 0; i < 32; i++)
delete pArray[i];
and of course delete pArray.
|
|
|
|
|
Currently I had a MFC program written in Microsoft Visual Studio VC++ 6.0.
But it can only be run on a single machine.I would like to change it to web version, which can be browsed by the browser. Is there any efficient ways to do this without rewriting the whole program?
Thanks a lot.
chad yang
|
|
|
|
|
chad_yang wrote:
Is there any efficient ways to do this without rewriting the whole program?
Try Taking snapshots of all the screen and save individual HTM pages and then ..... NAH can't be done like that
i can't even remember what my point is now, but anyway, i'm correct
Barring unforeseen acts of God and Adminstrators, my server will be up tomorrow. I'm more worried about the Adminstrators.
|
|
|
|
|
Umm...
I see....
But does the "ActiveX control" help?
Thank you.
chad yang
|
|
|
|
|
Hi all,
I want to control the menus and toolbars of MS office document which is embedded in my application.for the same i am using a MFc app. and have embedded MS-Word application using Edit->Insert New Object selecting MS word document from Dialog box.
Now how i can capture the events from menus and toolbar in my application.?
I have googled for the same,but not able to find any relevent infomation.
May be i am using wrong keywords.
Can someone reply me how to start with, any articles or sample code will be a great help.
Thanks in Advance,
Abhishake
|
|
|
|
|
try to find something into http://www.codeproject.com/com/xoffice.asp
|
|
|
|
|
how shall i add a button to IE toolbar using VC++. as givent in the following link.
http://msdn.microsoft.com/library/default.asp?url=/workshop/browser/ext/tutorials/button.asp
plz help me..
ComputerNewton
|
|
|
|
|
How to change the description of an service shown in SCM
|
|
|
|
|
SC_HANDLE hSCM;
hSCM = OpenSCManager(
NULL,
NULL,
SC_MANAGER_ALL_ACCESS
);
if(hSCM==NULL)
{
LOGERROR("ERROR opening SC manager");
}
SERVICE_DESCRIPTION sd;
sd.lpDescription=sDescription;
SC_HANDLE hService=OpenService(hSCM, "My Service", SERVICE_ALL_ACCESS);
ChangeServiceConfig2(hService, SERVICE_CONFIG_DESCRIPTION,&sd);
CloseServiceHandle(hService);
CloseServiceHandle(hSCM);
It's not a bug, it's an undocumented feature. suhredayan@omniquad.com
messenger :suhredayan@hotmail.com
|
|
|
|
|
I'm starting work on an MFC-based MDI project (does not use document-view architecture). If completed, it will employ some three dozen view classes, each consisting of 2 or more dot-CPP/dot-H pairs. This will make the project space somewhat crowded.
I was thinking of organizing the view-class files in static libraries, to reduce clutter and increase comprehensibility of the workspace.
Can anyone comment on this? Is there a better way?
Thanks, RD
|
|
|
|
|
I have been using the following section of code to send data to COM1:, but keep getting the error 87 = 'Incorrect function' when I send data to the port.
Note I have setup the device as a generic text printer and that works OK.
Code Listing:-
DWORD cbWritten; // No of bytes written
char mystring[255]; //string variable
int len; //Init the len variable for use of sizing our string
int error;
//set the handle for the CreateFile function
HANDLE hCom = CreateFile( "COM1:",GENERIC_WRITE | GENERIC_READ ,0, 0, OPEN_EXISTING, 0, NULL);
//Init the settings for the DCB (device control block) structure
DCB dcb; //Init the device control block
dcb.BaudRate = 300; //set baud rate
dcb.ByteSize = 8; //Set Bytes
dcb.Parity = NOPARITY; //Set Parity
dcb.StopBits = ONESTOPBIT; //Set stop bit
dcb.fTXContinueOnXoff=TRUE; // XOFf Sent Does Not Stop trans
dcb.fOutX=FALSE; // No Xon/Xoff on Output
dcb.fInX=FALSE; // No Xon/Xoff on Input
dcb.fErrorChar=FALSE; // No error Char in Parity Error
dcb.fNull=FALSE; // Accept Null Characters
dcb.fRtsControl=RTS_CONTROL_DISABLE; // No RTS Flow Control
dcb.fDtrControl=DTR_CONTROL_DISABLE; // No DTR Flow Control
dcb.fAbortOnError=FALSE; // Do Not Abort on error
//Set the port state
error = SetCommState(hCom, &dcb);
if(error != 0)
{
printf("Error Sending Data %d \t", GetLastError());
DisplayErrorText(error);
}
else
printf("State Set OK \n");
//get and size what's gotten
printf("Enter string: ");
gets(mystring); //Get input from keyboard
len = strlen(mystring); //get true length of string
//Output to the com port
error = WriteFile(hCom, mystring, len, &cbWritten, NULL); //write mystring to port
if(error != 0)
{
printf("Error Sending Data %d \t", GetLastError());
DisplayErrorText(error);
}
error = WriteFile(hCom, "\r\n", 2, &cbWritten, NULL); //write return and newline to port
if(error != 0)
{
printf("Error Sending CR/LF %d \t", GetLastError());
DisplayErrorText(error);
}
if(FlushFileBuffers(hCom) == 0)
{
printf("Faied To Flush Buffers \n");
}
printf("Enter Key to Close: ");
gets(mystring); //Get input from keyboard
CloseHandle(hCom); //close the handle
return 0; //exit
|
|
|
|