|
If you set a breakpoint at the constructor the debugger will see it.
If I use the global var in my main program then the constructor is called. However what I want is not to use this object. I dont even want to know its existance out of my .lib, I just want to execute sth just before main begins.
Themis
|
|
|
|
|
if u really want to know that global object ctor is call (which will definate be called when the object is instantiated).put this in the ctors cout<
|
|
|
|
|
|
I just want to develope an application like Windows help with SDI. It will contain a rich edit control and a tree control.
How can i do that?
We Believe in Excellence
|
|
|
|
|
Make use of CFormView in the last step, where the base class information is displayed. CFormView is the best solution for placing controls on the view which has to be displayed first.
Work hard and bit of luck is KEY to SUCCESS.
|
|
|
|
|
In VC6 the MFC AppWizard has an option to make an "Explorer like" app, with a splitter that contains a tree, and a view window of a class you pick (rich edit in your case).
--Mike--
Visual C++ MVP
LINKS~! Ericahist | 1ClickPicGrabber | CP SearchBar v2.0.2 | C++ Forum FAQ
Pinky, are you pondering what I'm pondering?
I think so Brain, but how will we fit the hamster inside the accordion?
|
|
|
|
|
hai..I have a guestion about how to save a data of the application in VC++ to a xxx.txt file.My application is a counter which is counting the numbers from 0 until 100 by pressing the control button. My purpose is to get the count data after every time pushing the control button from dialog. I try to make a program. It is very simple, but the data is strange.
No Count Time
1. 0Pulse 0Sec
2. 100Pulse 5Sec
3. 200Pulse 10Sec
The data should be like this,
No Count Time
1. 100Pulse 5Sec
2. 200Pulse 10Sec
3. 300Pulse 15Sec
If look at the first table No.1 data start with 0 for count and 0 for time.It is not true because it value should be 100 for count and 5 for time.
If anybody has an idea please teach me.
bye..
agus
|
|
|
|
|
Well, it's kind of hard to tell you why it fires before any pulse when you've not shown us the code.....
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Hai...tq you for the message reply.Here I want to make sure the way a fail is created for saving an application in xxx.txt file is correct or wrong.At dialog, I create a control button for the output pulse and an edit box for showing a giving pulse.For data saving, I create the fail for saving the application data or here for saving the output pulse and the time.I create the fail by adding Member Function in PUBLIC and with named the function as OnData().At //CxxxDlg message handlers code is added for saving a data as below,
///////////////////////////
// CxxxxDlg message handlers
void CProDlg::OnPulseout() // Pulseout button
{
// TODO: Add your control notification handler code here
//Pulse Setting
.................
.................
.................
OnData(); //I add OnData here for dialog read and save the data every
//time botton is clicked
}
void CProDlg::OnData()// This function is created by Add Member Function
{
std::fstream cFStrm
("xxxx.txt",std::ios::out );
cFStrm
<
|
|
|
|
|
agus75 wrote:
m_sec<<
This is obviously initialised to 0. When is it changed ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
m_sec is a time taking each time the pulseout botton is clicked.The first time the button is clicked, m_sec is start count and after second time clicking the button, its value will return to 0 and will start count again until clicking for third time.
//Control Button Function
void CTruDlg::OnPulseout()
{
// TODO: Add your control notification handler code here
..........
..........
..........
SetTimer=(1,10,NULL)
m_sec=0;
m_sec++;
//A function to save a data
OnData();
}
I have a question about creating a function in dialog without using the application wizard.In my application it is same as OnData() function. I create it by right hand click at CxxxDlg at workspace and click at Add member Function.[Function Type--->Void],[Function Declaration-->OnData] and [Access--->PUBLIC]. I am not very clear the application of Access which has three parameters PUBLIC,PRIVATE and PROTECTED. Does it means that by choosing PUBLIC I can freely put the function at any places in dialog OR does it means that the another function can share this function without declare it first. I means If want to save the data in xxx.txt which is controlled by OnData() function, OnData() function must be declare in the function which need it to save the application.The example is as below,
void CxxxxDlg::OnPulseout()
{
// TODO: Add your control notification handler code here
..........
..........
..........
//A function to save a data or declaration OnData() in the Pulseout()
function which need it to save the parameter.
OnData();
}
Thank You.
agus
|
|
|
|
|
agus75 wrote:
m_sec=0;
m_sec++;
Why not just set it to 1 ?
agus75 wrote:
I am not very clear the application of Access which has three parameters PUBLIC,PRIVATE and PROTECTED.
Public is visible to any client of the class. Protected is visible to classes derived from this class, and friend classes. Private is not visible to anything but this class.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Is there any way of detecting and reporting of keylogging activity?
Presenting details of the program that is performing the keylogging activity?
|
|
|
|
|
Use WindowsHooks. You might be able to detect it that way.
Don't try it, just do it!
|
|
|
|
|
In the vc.net, if you set a dialog with child style, its menu property is disable. I need to use a pull down menu bar in my child dialog, but I havn't got the way.
So how to resolve it?
Thanks!
|
|
|
|
|
Hi ,
I want a way to capture the screen with Mouse Icon,
Please help me,
Very Important,
Thanks,
MILAD.
Every new thing you learn,Gives you a new personality.
|
|
|
|
|
I don't know if the mouse gets included in a screen grab. AFAIK to grab the screen (desktop) you use GetDC(NULL). To get the mouse pointer you could fake it by getting the mouse position and then drawing a pointer on the screen grab bitmap at the right point.
If there is a better way I would be interested to know.
|
|
|
|
|
|
I have been working on a plugin for IE that will look for specific data in html pages and modify its presentation. I have the code to get the source, change the source and finally stream it back into the web browser, but I have come accross a problem that I never expected.
When I use IStream to stream the modified data back into the web browser, it no longer associates the html file with the originating web site. So if the web page that I changed had a relative link to a css file with the address of /css/format.css, I end up with a webpage that looks for the file locally (maybe even not at all) rather than the remote directory as was intended. It ends up trying to look for the file locally instead of the web server. Below is an example of the relative address issue.
<!-- InstanceBegin template="/Templates/inside-template.dwt" codeOutsideHTMLIsLocked="false" -->
Is there a way, without further modifying the page, to make the new data reference the server just like the original page did. I don't want to modify the page more because that would entail having to modify other files as well. (i.e., The *.dwt file listed above also has relative links in it as well.)
I have tried searching for ways to do this, but I am not even sure where to begin as I am not even sure what to call the problem. It is as if I need to tell internet explorer what the base address is for the streamed data that is being displayed.
Please let me know if you have any ideas or creative ways to avoid the problem altogether.
|
|
|
|
|
I have a series of small bitmaps I need to print. The bitmaps are approx. 20 pixels wide and 15 pixels high. I would like them to print on the printer at about 1/4" or so high and 3/4" wide. I figured I could use the StretchBlt call to do this. I am using the following code:
// nTxtHt holds the height of a line of text to be printed
CBitmap bmp;
bmp.LoadBitmap (nBmpID);
BITMAP bm;
bmp.GetBitmap (&bm);
int nWd = bm.bmWidth;
int nHt = bm.bmHeight;
int nWide = MulDiv (nWd, nTxtHt, nHt);
CDC memDC;
memDC.CreateCompatibleDC (pDC);
CBitmap *pBmpOld = memDC.SelectObject (&bmp);
CRect rc (CPoint (nX, nY), CSize (nWide, nTxtHt));
pDC->Rectangle (&rc);
pDC->StretchBlt(nX, nY, nWide, nTxtHt, &memDC, 0, 0, nWd, nHt, SRCCOPY);
memDC.SelectObject(pBmpOld);
The framing rectangle prints just fine. The bitmap prints fine in preview. But when printed to printer, it shows up as a dot.
What am I doing wrong here?
|
|
|
|
|
If your printer is 300 DPI, then a 300x300 bitmap will by one inch by one inch. So you need to work out the size of the printer DC, then you can work out how big you need to stretchblt the bitmap.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
In VC++6 MFC I'm using the CFileDialog Class to get a filename from the user as in the code below.
How do I write ASCII data to the file that is returned. How can I write "Hello World" to the file. Can I use fprintf? What would the file handle be?
char strFilter[] = { "CANMon Files (*.canmon)|*.canmon|All Files (*.*)|*.*||" };<br />
<br />
CString canLogFile;<br />
<br />
CFileDialog FileDlg(FALSE, ".bcr", NULL, 0, strFilter);<br />
<br />
if( FileDlg.DoModal() == IDOK )<br />
{<br />
f.Open(FileDlg.GetFileName(), CFile::modeCreate | CFile::modeWrite);<br />
CArchive ar(&f, CArchive::store);<br />
<br />
canLogFile = FileDlg.GetFileName();<br />
sprintf(szPrintString, canLogFile);<br />
m_logboxTestVariable.AppendString (canLogFile);<br />
<br />
}<br />
|
|
|
|
|
Freddie Code wrote:
How do I write ASCII data to the file that is returned.
Use CFile::Write() or CStdioFile::WriteString() .
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
Hello,
I was wondering if someone knows how to retrieve the windows PID as normal text like 123-123456 from the registry (it's binary value) and display it.
Thanks,
D.
|
|
|
|
|
What is the registry key/value that you are interested in?
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|