|
B cannot see A's privates. If you made the variable protected, it would be visible to B. Otherwise you can make B a friend class of A, but in this case that would be kind of redundant, unless A has other classes derived from it which should be disallowed from seeing A's private stuff.
Christian
NO MATTER HOW MUCH BIG IS THE WORD SIZE ,THE DATA MUCT BE TRANSPORTED INTO THE CPU. - Vinod Sharma
Anonymous wrote:
OK. I read a c++ book. Or...a bit of it anyway. I'm sick of that evil looking console window.
I think you are a good candidate for Visual Basic. - Nemanja Trifunovic
|
|
|
|
|
I feel real dumb for having to resort to this but I cannot find what I need to know anywhere.
In an MFC App (VS.NET)I have a button in my dialog box. I thought that when I double click it in design view it would generate the code for the button click event -- then all I would have to do is fill in the code (VS does this on the computers at school). But (at home) when I double click a button in design view Visual Studio gives me the MFC Add Class wizard. I tried adding the code by hand but it didn't work. I think the event I wrote by hand didn't get attached to my button. Anyway...is there a setting in Visual Studio that will chanage this so that when I double click a button in design view the code for a button click event will be generated??
Thanks for you help!
"It has become appallingly obvious that our technology has exceeded our humanity."
- Albert Einstein (1879-1955)
"I think there is a world market for maybe five computers."
- Thomas Watson (1874-1956), Chairman of IBM, 1943
"640K ought to be enough for anybody."
- Bill Gates (1955-), in 1981
"Half this game is ninety percent mental."
- Yogi Berra
|
|
|
|
|
I guess you haven't associated a class with your dialog resource. First you need to do that - associate a CDialog derived class with the dialog resource; only after that will dbl-clicks on control result in their mouse click handlers getting automatically created for you
Nish
Author of the romantic comedy
Summer Love and Some more Cricket [New Win]
Review by Shog9
Click here for review[NW]
|
|
|
|
|
Ok I did that and it gives me the event but i created a new header file and cpp file. I want the event to be generated in my ...View.cpp file without it creating a seperate .h and .cpp
Do you know how to do that?
"It has become appallingly obvious that our technology has exceeded our humanity."
- Albert Einstein (1879-1955)
"I think there is a world market for maybe five computers."
- Thomas Watson (1874-1956), Chairman of IBM, 1943
"640K ought to be enough for anybody."
- Bill Gates (1955-), in 1981
"Half this game is ninety percent mental."
- Yogi Berra
|
|
|
|
|
How can i understand one program is terminated?
for example suppose the NOTEPAD.EXE is running ,now i want to be notified whenever
that it is terminated? It is very important for me to understand.Please Help Me.
Please excuse me for bad comments,my english isn't well.
Thanks a lot.
|
|
|
|
|
If you have it's process handle, you can wait on the handle using one of the WaitForXXXX API calls.
Else if you have the HWND of the window, just do an IsWindow on it and then do a GetWindowText etc... and verify that it;s the same window.
Nish
Author of the romantic comedy
Summer Love and Some more Cricket [New Win]
Review by Shog9
Click here for review[NW]
|
|
|
|
|
check out my winsock hook - api hooking revealed article , hook the TerminateProcess() function and get notified of any process closing !
//more in the article
//rate me or hate me
I am the mighty keeper of the book on knowledge . Contact me to get your copy .
|
|
|
|
|
I want to read a file from a NT. the path is \\nt\mydata\myfile.txt. I write the following:
CFile aa.Open("\\\\nt\\mydata\\myfile.txt",CFile::modeRead);
but the above always is wrong! mybe it can't read the file from a network.
What is wrong with these? what can i do for this?
Please help me! Thanks a lot!
|
|
|
|
|
Let say you have computer, named nt...
1) Connect to remote computer:
CString strNetPath("\\\\nt\\MyData");
NETRESOURCE netRc;
ZeroMemory(&netRc, sizeof(netRc));
netRc.dwType = RESOURCETYPE_DISK;
netRc.lpRemoteName = (LPCTSTR) strNetPath;
WNetAddConnection2(&netRC, "Password", "UserName", NULL);
if(dwResult != NO_ERROR)
{
MessageBox( NULL, "Connection Failed", "Yeap", MB_OK);
return;
}
CFile aa.Open("\\\\nt\\mydata\\myfile.txt",CFile::modeRead);
|
|
|
|
|
When I add a new record to the Oracle table, I also want to get back to it to update more fields after some process.
Here is an example:
m_pSet->m_strFilter = "";
m_pSet->m_strFilter = "create_date desc";
m_pSet->Requery();
.
.
.
m_pSet->AddNew(); //line1
m_pSet->m_NAME = "Elizabeth"; //line2
m_pSet->Update(); //line3
m_pSet->Requery(); //line4
UpdateData(FALSE); //line5
line5 does not display data from the newly added record.
I tried using the primary key employee_id to locate the record. Unfortunately, employee_id is updated by the Insert trigger.
How can I get back to the newly added record?
-Elizabeth
Eilzabeth
|
|
|
|
|
Iam not exactly clear of what u want the program to do when Updatedata() is executed .
But when u Add records using AddNew() and execute Update() ,the record which was previously the current becomes the current record after Update() - I hope this is 'nt confusing !!!!!!
eg .
Before AddNew()
Current Record :A ( say)
Now you add record "B" .
Execute Update()
Now
Current Record :A( still it is A)
|
|
|
|
|
I see. No wonder I don't see the newly added record as the current record. Plus, If I loop through all the records in the recordset, the new record is not even there unless I do a Requery. Is there an easy way to get to the new record (assuming the recordset is sorted the way that the newly added record is not neccessary the first or the last in the recordset)?
Eilzabeth
|
|
|
|
|
It depends on how you open the recordset .If open it in snapshot mode or in dynaset mode ,ReQuery() is absolutely required .But if yyou open it in dynamic mode ,it is not required .However most of the Databases don't support "dynamic" recordsets .
Evene before Requery() ,u have to use CanRestart () function to check if rthe recordset can be requerried !!!!
|
|
|
|
|
main () {
for ( ; ; ) {
printf ("Hung up\t\b\b\b\b\b\b") ;
}
}
Paul Watson wrote:
"At the end of the day it is what you produce that counts, not how many doctorates you have on the wall."
George Carlin wrote:
"Don't sweat the petty things, and don't pet the sweaty things."
Unknown wrote:
"I love long walks, especialy taken by those that annoy me."
Paraphrased from TMNT:
"Cricket? You have to know what a crumpet is to understand Cricket."
|
|
|
|
|
Yeah, this has been discussed many times. I think the backspaces go past the beginning of the line because of a problem with how tabs are accounted for.
Christian
NO MATTER HOW MUCH BIG IS THE WORD SIZE ,THE DATA MUCT BE TRANSPORTED INTO THE CPU. - Vinod Sharma
Anonymous wrote:
OK. I read a c++ book. Or...a bit of it anyway. I'm sick of that evil looking console window.
I think you are a good candidate for Visual Basic. - Nemanja Trifunovic
|
|
|
|
|
No no you've got it all wrong - you are supposed to post it with the title "This is the answer to your homework"...
David Wulff
"David Wulff can't live without me, so you shouldn't either" - Paul Watson
|
|
|
|
|
Um... sorry... wrong... not homework. I found it ont he Internet because I was searching for a way to induce a BSOD for some testing I am doing but did not understand WHY it worked.
I Figured that it had something to do with the way it revereses through the buffer, but I could not understand why the tab had anything to do with it.
Paul Watson wrote:
"At the end of the day it is what you produce that counts, not how many doctorates you have on the wall."
George Carlin wrote:
"Don't sweat the petty things, and don't pet the sweaty things."
Unknown wrote:
"I love long walks, especialy taken by those that annoy me."
Paraphrased from TMNT:
"Cricket? You have to know what a crumpet is to understand Cricket."
|
|
|
|
|
No no no no no no no - not you posting a homework question, but rather you posting an answer to all the people who are posting homework questions. Get it now?
David Wulff
"David Wulff can't live without me, so you shouldn't either" - Paul Watson
|
|
|
|
|
Yes I get it....
I have found it... the elusive registry key that makes Windows crash..
http://support.microsoft.com/?kbid=244139[^]
This is so funny I can't wait to try it out.
Paul Watson wrote:
"At the end of the day it is what you produce that counts, not how many doctorates you have on the wall."
George Carlin wrote:
"Don't sweat the petty things, and don't pet the sweaty things."
Unknown wrote:
"I love long walks, especialy taken by those that annoy me."
Paraphrased from TMNT:
"Cricket? You have to know what a crumpet is to understand Cricket."
|
|
|
|
|
I wrote a function to write an integer to a file (i also wrote a function to write a string to a file, which works almost exactly the same way) but windows gives me an access violation error on it or something (the string function works fine btw, so its not the file mode etc.).
Here's the code:
int WriteInt(int Int, long pos)
{
if(fseek(npf, pos, SEEK_SET))
{
return -1;
}
int numwritten = fwrite((void*)Int, sizeof(int), 1, npf);
if(numwritten!=1)
{
return -1;
}
return 1;
}
npf is a valid open file stream to which i CAN write strings etc.
Any ideas why this wont work?
Kuniva
--------------------------------------------
|
|
|
|
|
Kuniva wrote:
int numwritten = fwrite((void*)Int, sizeof(int), 1, npf);
You are converting an integer to a memory address - so it will try to read from the address of the value currently in Int. Try:
int numwritten = fwrite(&Int), sizeof(int), 1, npf);
Dave
|
|
|
|
|
thanks, it solved my problem
Kuniva
--------------------------------------------
|
|
|
|
|
I am looking for a sample where you can paste in HTML format.
I got Rich Edit control and strData contains like this
{\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fnil\fcharset0 MS Sans Serif;}}
\viewkind4\uc1\pard\f0\fs17
\par \b Test\b0
\par
What I am expecting is like this:
< HTML > (intended spaces there)
< B >Test < / B> (intended spaces there)
< / HTML> (intended spaces there)
Code from Copy to Clipboard function:
UINT format = ::RegisterClipboardFormat("HTML Format");<br />
<br />
if (strData.IsEmpty())<br />
return;<br />
<br />
CSharedFile sf(GMEM_MOVEABLE|GMEM_SHARE|GMEM_ZEROINIT);<br />
sf.Write(strData, strData.GetLength() * sizeof(TCHAR));<br />
<br />
if (!OpenClipboard())<br />
return;<br />
<br />
EmptyClipboard();<br />
<br />
SetClipboardData(format, sf.Detach());<br />
<br />
CloseClipboard();
But when I paste into another control(Edit), all I get is RTF only.
Do I need to convert from RTF format to HTML format??
If yes, then what's the use of CF_HTML("HTML Format") parameter??
Kant
|
|
|
|
|
DevStudio includes utility DataObjectViewer to allow you play with Clipboard.... (Enum Formats etc ).
I belive RichEdit does not support CF_HTML.
|
|
|
|
|
In my application there is a choice of two languages, Norwegian or English. They use different locales with comma or periode as decimal symbol, respectively. I'd like the decimal symbol on the numeric keypad to return the symbol which corresponds to the locale, whereas the comma/periode on the main keypad should remain unchanged. Excel has this functionality
I guess I should put an if() statement in OnChar(). I've noticed that the nFlags parameter in OnChar()is different if the decimal symbol is pressed from the numeric keypad or the main keypad, but I can't figure out how to interpret it. MSDN also has a statement that applications can not extract usefull information from nFlags. So, any tips..?
Regards, Haakon S.
|
|
|
|