|
I'm pretty sure this has been asked before but have no idea what topic to search on. In the VC6 IDE, when you are editing a file and put your mouse over a variable, the definition of that variable is displayed in "baloon help".
e.g. for my case I had a var declared: char m_Count[70]. So putting cursor over m_Count displays the above.
However, when I redefined the variable to be 80 elements big, the baloon help still says 70 even though I did a complete rebuild. There's probably a file, I have to delete and regenerate but besides the .clw, I'm not sure I could recover gracefully if I deleted the wrong file.
|
|
|
|
|
|
That worked great !! Thanks
|
|
|
|
|
Can anybody please tell me what message is sent from a toolbar control to the main window when a button is clicked on a toolbar?
Thanks in advance,
Paddy
|
|
|
|
|
WM_COMMAND, exactly as from the menu.
|
|
|
|
|
Thanks for the help,
So if I have a button on my toolbar IDT_BUTTON1, I can put in a
<br />
Case IDT_BUTTON1:<br />
in my main WndProc and it should work?
Paddy
|
|
|
|
|
I want to confirm this, but with using breakpoints:
BOOL ret = pImageDisplay->Create(IDD_IMAGEDISPLAY, this);
pImageDisplay->m_zoomFactor = 300;
first the code stepped into Create(), then it went into OnInitDialog, and then came back out to the zoomFactor assignment. So if I had pImageDisplay->m_zoomFactor = 100; in OnInitDialog, and then above, after CReate() I change it to: pImageDisplay->m_zoomFactor = 300; , then I do ShowWindow, its the 300 that should take effect since it overrides the 100 from OnInitDialog. Is this correct? I try to check this out by stepping etc, but the results are inconclusive....
Appreciate your help,
ns
|
|
|
|
|
The value would probably be shown as 100 as OnInitDialog() will call the DDX_... functions. This will use the value of m_zoomFactor which is current (100) before the change in the line after. You could always set it before the call to create. Of course this all depends on how m_zoomFactor is used.
Roger Allen
Sonork 100.10016
Were you different as a kid? Did you ever say "Ooohhh, shiny red" even once? - Paul Watson 11-February-2003
|
|
|
|
|
So the location of the assignment does matter! I guess if its before the Create(), it gets overridden by whats in OnInitDialog.....that fact too I wasnt able to determine conclusively but I'l test again. Makes sense that the order should matter...
Appreciate your help,
ns
|
|
|
|
|
i want to use new help file (old is *.hlp), before start, i need basic idea about it:
1. must create html first (old is rtf)
2. no control id features (old has, id links to specified page).
3. what is its extension (old is hlp)? it needs more time to develop than old ones?
any more comments are useful.
thx.
includeh10
|
|
|
|
|
includeh10 wrote:
want to use new help file (old is *.hlp), before start, i need basic idea about it:
1. must create html first (old is rtf)
Yes. You could create a selection of html pages, and their pics (gif, jpg, etc) using your
favourite html editor. You could even use work (but shouldn't; it's horribly inefficient).
2. no control id features (old has, id links to specified page).
You refer to the original html file (and any #anchors) in the help file.
3. what is its extension (old is hlp)? it needs more time to develop than old ones?
.chm (Compiled Html M????). It can be quicker than the old, as their are lots of tools around
for developing websites which are useful here.
any more comments are useful.
You should look at in the htmlhelp directory on your vc++ 6 cd. I don't know about .NET. I know
the software used to be downloadable from microsoft. I assume it still is. It comes with help
files which should answer most of your question. MSDN library also has the htmlhelp documentation
in it.
Iain.
|
|
|
|
|
With new help you probabably mean HTMLHelp.
includeh10 wrote:
1. must create html first (old is rtf)
Yes, but there should be some tools to convert it.
includeh10 wrote:
2. no control id features (old has, id links to specified page).
HTMLHelp of course sopports context help. See this[^].
includeh10 wrote:
3. what is its extension (old is hlp)? it needs more time to develop than old ones?
chm
Pavel
Sonork 100.15206
|
|
|
|
|
Is there any SDK function or so on - to
logoff Windows user. But I don't mean ExitWindow(
to logoff current user, but if more users is logged.
(you can see (must be Administrator) them in task list CTRL+ALT+DEL
and do login off there)
Like: I will enum users loged on and I need some
chance to chose some from this list and logged him off.
Thank you
Viliam
|
|
|
|
|
How can we create magic packet and brodcast it to a network(I am familiar with Magic packet.., i need the method to create and broadcast)I need it for making Wake On Lan;)
|
|
|
|
|
is there any way to get the facename from a TTF file ?
Thanx
|
|
|
|
|
CString ReadLongName(const char *pszFile)
{
CString csOutName;
static char lpszLongName[256];
unsigned i;
char namebuf[255];
FILE* fp;
unsigned short numNames;
long curseek;
unsigned cTables;
sfnt_OffsetTable OffsetTable;
sfnt_DirectoryEntry Table;
sfnt_NamingTable NamingTable;
sfnt_NameRecord NameRecord;
lpszLongName[0] = '\0';
if ((fp = fopen (pszFile, "rb")) == NULL)
{
return csOutName;
}
fread (&OffsetTable, 1, sizeof (OffsetTable) - sizeof(sfnt_DirectoryEntry), fp);
cTables = (int) SWAPW (OffsetTable.numOffsets);
for ( i = 0; i < cTables && i < 40; i++)
{
if ((fread (&Table, 1, sizeof (Table), fp)) != sizeof(Table))
{
return csOutName;
}
if (Table.tag == tag_NamingTable)
{
fseek (fp, SWAPL (Table.offset), SEEK_SET);
fread (&NamingTable, 1, sizeof (NamingTable), fp);
numNames = SWAPW(NamingTable.count);
while (numNames--)
{
fread (&NameRecord, 1, sizeof (NameRecord), fp);
curseek = ftell(fp);
if (SWAPW(NameRecord.platformID) == 1 &&
SWAPW(NameRecord.nameID) == 4)
{
fseek (fp, SWAPW (NameRecord.offset) +
SWAPW(NamingTable.stringOffset) +
SWAPL(Table.offset), SEEK_SET);
fread (&namebuf, 1, SWAPW(NameRecord.length), fp);
namebuf[SWAPW(NameRecord.length)] = '\0';
lstrcpy(lpszLongName,namebuf);
fseek (fp, curseek, SEEK_SET);
csOutName = lpszLongName;
}
}
break;
}
}
fclose (fp);
return csOutName;
}
Be very, very careful what you put into that head, because you will never, ever get it out. --Thomas Cardinal Wolsey
|
|
|
|
|
great help , Thank you
|
|
|
|
|
Is there a way to hide a running app from task manager? Can I hide this app so that it will not be seen when alt-tab is pressed?
Thanks!
----------------------
Senior Software Developer
William Dicks
http://www.nanoteq.com/
|
|
|
|
|
This seems like a "try google" type question, but I honestly have and can't find a tutorial anywhere.. so:
Where can I learn to create my own control for an MFC app using visual c++?
Cheers,
Rewbs
|
|
|
|
|
See the beginner's section here, should be everything you need:
http://www.codeproject.com/miscctrl/
James.
|
|
|
|
|
It doesn't work....
I make a ADO connection with my database in my app:
myapp.cpp:<small><br />
void CMyApp::CMyApp()<br />
{<br />
<br />
try <br />
{<br />
HRESULT hr = m_pConn.CreateInstance (__uuidof (Connection));<br />
<br />
if (FAILED (hr))<br />
{<br />
AfxMessageBox ("Can't create intance of Connection");<br />
}<br />
<br />
if (FAILED (m_pConn->Open (_bstr_t ("Provider=Microsoft.Jet.OLEDB.4.0;Data Source = Database.mdb"),<br />
_bstr_t (""), _bstr_t (""), adModeUnknown)))<br />
{<br />
AfxMessageBox ("Can't open datasource");<br />
}<br />
}<br />
catch ( _com_error &e )<br />
{<br />
_bstr_t bstrSource (e.Source());<br />
_bstr_t bstrDescription (e.Description());<br />
TRACE ( "Exception thrown for classes generated by #import" );<br />
TRACE ( "\tCode = %08lx\n", e.Error ());<br />
TRACE ( "\tCode meaning = %s\n", e.ErrorMessage ());<br />
TRACE ( "\tSource = %s\n", (LPCTSTR) bstrSource);<br />
TRACE ( "\tDescription = %s\n", (LPCTSTR) bstrDescription);<br />
<br />
AfxMessageBox ((LPCTSTR) bstrDescription);<br />
}<br />
catch (...)<br />
{<br />
TRACE ( "*** Unhandled Exception ***" );<br />
}<br />
<br />
}<br />
</small>
Header file:
myapp.h:<small><br />
CDatabaseClass AppDatabase;<br />
_ConnectionPtr m_pConn;<br />
</small><br />
Then i send the pointer(m_pConn) to a new made class and check the database:
myapp.cpp:<small><br />
void CMyApp::CheckLogin()<br />
{<br />
AppDatabase.m_pConn = m_pConn;<br />
if (AppDatabase.CheckLogin(Name, Pass))<br />
{<br />
AfxMessageBox("login correct");<br />
}<br />
}<br />
</small>
Check Function(here it goes wrong):
DatabaseClass.cpp:<small><br />
bool CDatabaseClass::CheckLogin(CString Naam, CString Pass)<br />
{<br />
bool login;<br />
try <br />
{<br />
CString tmpNaam, tmpPass;<br />
<br />
Naam.Replace("'", " ");<br />
Pass.Replace("'", " ");<br />
<br />
login = FALSE;<br />
<br />
_CommandPtr pCommand;<br />
pCommand.CreateInstance (__uuidof (Command));<br />
pCommand->ActiveConnection = m_pConn;<br />
pCommand->CommandText = "Select * From Gebruikers;";<br />
<br />
_RecordsetPtr pRecordset;<br />
pRecordset.CreateInstance (__uuidof (Recordset));<br />
pRecordset->CursorLocation = adUseClient;<br />
pRecordset->Open ((IDispatch *) pCommand, vtMissing, adOpenForwardOnly, adLockReadOnly, adCmdUnknown);
<br />
while (!pRecordset->GetadoEOF())<br />
{<br />
tmpNaam = (char *) (_bstr_t) pRecordset->Fields->GetItem("Naam")->Value;<br />
tmpPass = (char *) (_bstr_t) pRecordset->Fields->GetItem("Pass")->Value;<br />
<br />
if {(tmpNaam == Naam) && (tmpPass == Pass)) { login = TRUE; }<br />
<br />
pRecordset->MoveNext();<br />
}<br />
<br />
pRecordset->Close ();<br />
} <br />
catch( _com_error &e )<br />
{<br />
_bstr_t bstrSource(e.Source());<br />
_bstr_t bstrDescription(e.Description());<br />
TRACE( "Exception thrown for classes generated by #import" );<br />
TRACE( "\tCode = %08lx\n", e.Error());<br />
TRACE( "\tCode meaning = %s\n", e.ErrorMessage());<br />
TRACE( "\tSource = %s\n", (LPCTSTR) bstrSource);<br />
TRACE( "\tDescription = %s\n", (LPCTSTR) bstrDescription);<br />
}<br />
catch (...)<br />
{<br />
TRACE ( "*** Unhandled Exception ***" );<br />
}<br />
<br />
return login;<br />
}<br />
</small>
Well, this doesn't work, the while loop doesn't even get reached. I don't know what i do wrong. Is it possible to send the database pointer around like this?
[]D [] []D []
|
|
|
|
|
Hi,
I have a window CMyWnd implemented by ATL
(actually, it's an ActiveX full control, but that shouldn't matter...)
This window uses a 3rd party library to create a child window. All I have is the window handle of the child window.
to prefilter the messages that are sent to the child, I want to:
a) replace the WNDPROC of the child with a global function of my own
b) use a global map<hwnd-of-child, cmywnd="" *="">, where the CMyWnds register in OnCreate, and remove themselves in OnDestroy
c) in my own wndproc, using the map to call CMyWnd->FilterMessageFromChild(...)
d) the message decides whether it should be passed on to the original WNDPROC, or not
Question:
now, this (should) work like a charm, however, I see that most of what TL does is exactly the same: global WNDPROC, mapping to a CWindow-dereived class, and calling with an BOOL & bHandled parameter to decide if the message is passed on
Is it possible to reuse ATL's own infrastructure for that?
TIA
Peter
So many people long for eternity that don't know what to do on a rainy sunday afternoon. [sighist] | [Agile Programming] [doxygen] If you look for evil in me you will find it whether it's there or not.
|
|
|
|
|
Hi all,
I have a dockable CDialogBar in an MDI application, however once i have created the CDialogBar and declared it as dockable, how do I make it not dockable, ie cannot be moved around the screen. This is going to be a user setting option, therefore I need to be able to make the Dialog both docking enabled and docking disabled.
Any help would be highly appreciated
Thanks
Neo
|
|
|
|
|
Hello folks!
I'm getting completely nuts with this CWnd::SetFont function. I tried to change the font in my CListControl (m_list), but this sh** control doesn't care about this command!
What's wrong?
Here is my code:
CFontDialog dlg;<br />
dlg.DoModal();<br />
CString face(dlg.GetFaceName());<br />
<br />
CFont pFont;<br />
pFont.CreatePointFont(120,face);<br />
m_list.ResetContent();<br />
m_list.SetFont(&pFont);
Thanks for help!
Bye, Jan
|
|
|
|
|
seeing ur code..i guess the error is u are calling the dailog first to show then setting font..whereas u must do it like this..
CFont pFont;
pFont.CreatePointFont(120,face);
m_list.ResetContent();
m_list.SetFont(&pFont);
CFontDialog dlg;
dlg.DoModal();
CString face(dlg.GetFaceName());
although i could not make out what is this face for..(never mind..)
i hope this works now..
cheers
Himanshu
|
|
|
|
|