|
Good idea! I'm just so glad I could extend my class. Appreciate your advice.
Thanks,
ns
|
|
|
|
|
How can I change the default debugger?
Thanks,
Jon Sagara
"Bugs suck. Period."
-- John Robbins
|
|
|
|
|
If you are refering to the app that is launched when you get an error and you tell it to debug, look up AeDebug on MSDN. Its a registry entry.
Jason Henderson quasi-homepage articles "Like it or not, I'm right!"
|
|
|
|
|
1.
I've CEdit and a CButton on a CDialog. The CButton placed on top of the
CEdit. When the CButton is dragged up/down, I wish the CEdit will
streach/shrink, corresponding to the CButton bottom coordinate.
CAN SOMEONE LINK ME TO SOME ARTICLE THAT CAN RESOLVE MY ISSUE
2.
An article dealing with HOWTO create non-cubical windows/controls (please?)
10XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX a lot
--BlackSmith--
"With the help of all mighty", 2001, Me.
|
|
|
|
|
See the Owner Drawn Buttons section at this[^] page.
/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
use ownerdraw buttons for non-rectangular buttons and use WinAPI functions
CreatePolygonRgn
SetWindowRgn
etc.
for creating windows with arbitrary shape
|
|
|
|
|
quick, easy question:
how do I merge two std::set<ulong> sets into one?
for example:
std::set<ULONG> Aset;
std::set<ULONG> Bset;
...
...
...
...
Aset.merge( Bset );
I'm guessing I don't have to do it by hand (iterate BSet, adding all elements to ASet).
TIA,
Pete
|
|
|
|
|
use std::copy with a back_inserter, I would have thought.
Christian
We're just observing the seasonal migration from VB to VC. Most of these birds will be killed by predators or will die of hunger. Only the best will survive - Tomasz Sowinski 29-07-2002 ( on the number of newbie posters in the VC forum )
Cats, and most other animals apart from mad cows can write fully functional vb code. - Simon Walton - 6-Aug-2002
|
|
|
|
|
Didn't work, but that could have been me calling it wrong.
I ended up doing it by hand:
for( set_it = Bset.begin(); set_it != Bset.end(); set_it++ )
Aset.insert( set_it );
which does the job I guess...
Thanks anyway Christian
|
|
|
|
|
The standard, (and perhaps, the most common) way seems to be that if you want to create a bitmap button, you'd embed a CMyBitmap class object inside the view or the dialog, and from inside the definition of CMyBitmap you'd use LoadBitmapEx to load the bitmap, followed by using the SetBitmap function from CButton. (At least that's how I have been doing it.)
Then, I discover this book where the author totally seemed to avoid that path, and instead, embedded a CBitmapButton object inside the dialog, called Autoload from inside OnInitDialog to load his bitmap, and that was it. It worked!
However when I tried to emulate his technique, I have no success story to deliver. I didn't work for me.
Does anybody know what the author may have done to make his technique work, but didn't for me?
His name is Keith Bugg, and the book is, "Building Better Interfaces with MFC." His sample was part of Example 1.
Thanks.
William
|
|
|
|
|
is this anything like the CBitmapButton class that comes with MFC ?
-c
Conservative:
One who admires radicals centuries after they're dead.
-- Leo C. Rosten
|
|
|
|
|
Yep. But it's pretty clunky, um... basic.
/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
Interestingly, David Kruglinski, George Shepherd and Scott Wingo, on page 264 of their book, "Programming Microsoft Visual C++: Fifth Edition" shows something similar to what the other author whom I was talking about, had done.
CBitmapButton m_editCopy;
CBitmapButton m_editCut;
CBitmapButton m_editPaste;
BOOL CAboutDlg::OnInitDialog()
{
CDialog::OnInitDialog();
Verify(m_editCopy.AutoLoad(IDC_BUTTON1, this));
Verify(m_editCut.AutoLoad(IDC_BUTTON2, this));
Verify(m_editPaste.AutoLoad(IDC_BUTTON3, this));
return TRUE;
}
And they showed an illustration of a dialog window with the three Bitmap buttons. It obviously had to work for them also.
It got to be something else that they are doing, because the technique is not working for me.
William
|
|
|
|
|
When I double click on a file whose extension is handled by my MDI app, it starts to run the app but doesn't show the MainFrame properly (the floating dialogbar appears, but no main window or anything).
I get an error saying "Cannot find the file ... Make sure the path and filename are correct and that all required libraries are available."
I think these might be two separate problems, because when I click OK on the error message the half-opened application remains.
The same thing happens when another instance of the app is running. I'm not trying to do anything tricky here, like open the file in the same instance, which just seems too difficult. I've found similar postings on this forum but nothing that helps here.
thanks,
Jake
|
|
|
|
|
Did u serialize ur data?
Papa
Murex Co.
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
Yes, if I run the app normally and load in the file, everything works fine. Drag and drop also works fine. The only problems occur when double-clicking on files.
Jake
|
|
|
|
|
Does ur application name or path contains space characters?
Papa
Murex Co.
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
Hey guys
I have been desperately trying to export data (just varibles) from an executable and load them into a DLL but i can't get it to work so far i have tried extern and __declspec(dllexport) and dllimport. But i have had no luck any ideas on how i do this.
Peter
|
|
|
|
|
You can't do that. You can only export objects from a DLL to an executable or another dll.
|
|
|
|
|
Yeah but i really really need to do it
is there no way to work around it
|
|
|
|
|
Create the exported object in the dll, then in the application change its value. There is NO other way to do it. The reason should be obvious -- if the application were allowed to export and object, then the application would always have to be running whenever the dll is running. Lets say you have A.exe that export and object which X.dll uses. B.exe also uses X.dll but has no need for the object. When B.exe runs, X.dll is brought into memory, and because the dll references the object that was exported by A.exe, A.exe must also be executed.
One of the purposes of a dll is to share its data and functions among many different applications. It would be terribly inefficnent to do it the other way around.
|
|
|
|
|
Trying not to make any assumptions, I have been making my code so that strings retrieved from edit controls, the registry, etc dynamically allocate the space needed.
In my code I have been doing things such as this all over the place:
<br />
_TCHAR* pszString = NULL;<br />
int iLen = 0;<br />
<br />
iLen = SendDlgItemMessage(hWnd, IDC_EDITCNTRL, EM_LINELENGTH, (WPARAM)0, (LPARAM)0);
iLen++;
pszString = new _TCHAR[iLen];
ZeroMemory(pszString, iLen);
*(WORD *)pszString = iLen;
SendDlgItemMessage(hWnd, IDC_EDITCNTRL, EM_GETLINE, (WPARAM 0, (LPARAM)pszString);
<br />
<br />
delete []pszString;
<br />
This is of course just example code, but is the most optimized way to go about allocating the space for strings dynamically? I'm just curious how most people go about this in Windows.
Thanks!
. djrisc .
|
|
|
|
|
I've never seen anythging like this. Its much more sophisicated than I'm used to. Most code I've seen (and written for that matter) just allocates a large buffer and uses GetDlgItemText, letting the extra space (if any)just lie there.
I don't know if it is the most optimized, but it looks like it is considerably more efficient than the norm!
|
|
|
|
|
That is right - call with WPARAM and LPARAM of 0 to get the length, then add 1 for a null terminator.
Christian
We're just observing the seasonal migration from VB to VC. Most of these birds will be killed by predators or will die of hunger. Only the best will survive - Tomasz Sowinski 29-07-2002 ( on the number of newbie posters in the VC forum )
Cats, and most other animals apart from mad cows can write fully functional vb code. - Simon Walton - 6-Aug-2002
|
|
|
|
|
If you're doing that often I'd simpify the code to something like
CBuffer buffer(GetEditCtrlSize(hWnd, IDC_EDITCNTRL));
GetEditCtrlText(hWnd, IDC_EDITCNTRL, buffer);
where CBuffer is a class that does your new, zero, delete etc. Even better would be to use a std::vector as a buffer if you can.
Todd Smith
|
|
|
|