|
have you checked what function calling convention delphi uses?
it sounds like you might have a goofed up return address which is entirely plausible if the calling convention was wrong.
---
"every year we invent better idiot proof systems and every year they invent better idiots"
|
|
|
|
|
Doesn't Delphi use __fastcall as default?
If so, VC++ uses in your case __stdcall and thats a another calling scheme.
|
|
|
|
|
Doesn't Delphi use __fastcall as default?
VC++ uses __stdcall in your case and thats a another param scheme.
|
|
|
|
|
I really need, a tutorial abou this. Can you help me ... someone !
|
|
|
|
|
There's a really excellent book called Database Programming with Visual C++ in 21 days that covers this. Best of all its online and free!
Got to www.informit.com and look under databases, ADO...
|
|
|
|
|
Great information. Thank you very, very much.
|
|
|
|
|
Ok, I've created a "full control" in atl object wizard.
Edit, radio, etc - ok, except listbox nd combo.
The subclassed listbox control window somehow becomes a little bit smaller, then dimensions i used in m_ctlZZZ.Create(...,rect,...)
why?
where to debug?
|
|
|
|
|
The dimensions you enter in Create(....) are for the control container, not the control itself. You need to increase the size of the rect in the Create(....) function to account for this. I don't know the exact amount though.
|
|
|
|
|
Don't you know, where to read about this fact? MSDN - ok, but where in MSDN
Why only ListBox has such behaviour?
|
|
|
|
|
<<< In the name of GOD >>>
Hi all.
Please explain to me about this pointer,
I read MSDN help, but i didn't understand.
Please help me ...
Hadi Rezaie
|
|
|
|
|
its a pointer to the current object that is used for all sorts of hidden and some overt things ... its kinda fundamental to the c++ language
for instance, in a dialog class you could set the window title by calling either:
SetWindowText(blah blah blah)
or
this->SetWindowText(blah blah blah)
it mostly gets passed as a hidden parameter in various calls between objects and can be used as a return value if you want to pass the address of the current object to another object
hmmmmmm ... is actually a very deep subject if you examine the full uses of it
---
"every year we invent better idiot proof systems and every year they invent better idiots"
|
|
|
|
|
Good,
Now, What mean ::SetWindowText ???
Hadi Rezaie
|
|
|
|
|
you're kidding right?
---
"every year we invent better idiot proof systems and every year they invent better idiots"
|
|
|
|
|
It means calling the global function SetWindowText() instead of a member function of the current class.
|
|
|
|
|
This is really a basic question that any C++ book would cover in the first or second chapter.
While I have no problem helping people learn, I think that you should at least meet me halfway and have at least read some basic material covering C++.
Any decent book can do a much better job of teaching you the basics than we can in a few sentances on a board.
|
|
|
|
|
<<< In the name of GOD >>>
Hi,
I want to use Status Bar in my Dialog.
So, please write all code by CStatusBar class
for use StatusBar in dialog.
Thanks.
Hadi Rezaie
|
|
|
|
|
Have a look at
http://codeguru.earthweb.com/dialog/toolbars.shtml
Happy programming!!
|
|
|
|
|
Thanks for reply.
That is useful reply.
I have other question,
Now i want to indicate status about NUM, CAPS, ...
Please help me ...
Hadi Rezaie
|
|
|
|
|
Ok here goes.
1. Add to dialog header
CStatusBar m_wndStatusBar;
2. Define indicators array as you would in MainFrame of and SDI or MDI application
static UINT indicators[] =
{
ID_SEPARATOR, // status line indicator
ID_INDICATOR_NUM,
ID_INDICATOR_CAPS,
};
3. Create the status bar in InitDialog
if (!m_wndStatusBar.Create(this) ||
!m_wndStatusBar.SetIndicators(indicators,
sizeof(indicators)/sizeof(UINT)))
{
TRACE0("Failed to create status bar\n");
return -1; // fail to create
}
4. Add OnKickIdle function and Message Map entry
Message Map
ON_MESSAGE_VOID(WM_KICKIDLE, OnKickIdle)
Header
afx_msg void OnKickIdle();
Function
void CMyDlg::OnKickIdle()
{
m_wndStatusBar.OnUpdateCmdUI(reinterpret_cast<cframewnd*>(this), FALSE); // must cast
}
5. And finally the Handler entries
Message Map
ON_UPDATE_COMMAND_UI(ID_INDICATOR_CAPS, OnUpdateKeyIndicator)
Header
afx_msg void OnUpdateKeyIndicator(CCmdUI* pCmdUI);
Function
void CLittleBlackBookDlg::OnUpdateKeyIndicator(CCmdUI* pCmdUI)
{
UINT nVK;
UINT flag = 0x0001;
switch (pCmdUI->m_nID)
{
case ID_INDICATOR_CAPS:
nVK = VK_CAPITAL;
break;
case ID_INDICATOR_NUM:
nVK = VK_NUMLOCK;
break;
default:
TRACE1("Warning: OnUpdateKeyIndicator - unknown indicator 0x%04X.\n",
pCmdUI->m_nID);
pCmdUI->ContinueRouting();
return; // not for us
}
pCmdUI->Enable(::GetKeyState(nVK) & flag);
// enable static text based on toggled key state
ASSERT(pCmdUI->m_bEnableChanged);
}
Similarly if you want a toolar.
Happy programming!!
|
|
|
|
|
Ohhh, Yes.
Thanks a looooooooot.
Hadi Rezaie
|
|
|
|
|
if its a non-resizable dialog box why dont you just plonk some statc controls along the bottom and fake the status bar?
---
"every year we invent better idiot proof systems and every year they invent better idiots"
|
|
|
|
|
i have most of my projects on my main development machine but occasionally transfer them to my laptop to work elsewhere or as a temp backup ... if i load a project on my laptop under the exact same version of vc++ (ent ed 6 sp4) it takes literally 20 minutes to process the files in the project explorer view ... on my main machine it takes a few seconds
both machines are p2 350's with 128Mb ram ... anybody have a clue why this is?
---
"every year we invent better idiot proof systems and every year they invent better idiots"
|
|
|
|
|
NT, 2K or 95/98 ?
-c
------------------------------
Smaller Animals Software, Inc.
http://www.smalleranimals.com
|
|
|
|
|
ahhhh
the main machine is nt ws 4 sp6a ... laptop is w2k
what could be different as far as a vc project goes between os's?
duhhh
---
"every year we invent better idiot proof systems and every year they invent better idiots"
|
|
|
|
|
I know this is kind of a non-answer, but I have the same setup - an nt4 box and w2k lt, and I haven't seen this problem.
Mostly i don't bother to network the laptop, so when I move a project its zipped on a floppy - one big one zipped just fits, but I have to delete the big fat .ncb and ususally the .opt, aps etc.
Does it make any difference if you don't move these over? I guess if it did, the problem would only occur on the first load... hmmm... the only other wild idea I have is to see if VC is doing something over the network - that could muddy things.
|
|
|
|