|
Blake Miller wrote: if( !szString[0] )
This one's better if and only if you wrap it inside a function called
BOOL IsEmpty(char *str)
{
return !str[0];
}
Hey the function name can change
<marquee direction="up" height="30" scrolldelay="1" step="1" scrollamount="1" hspace="0" vspace="0">
--Owner Drawn
--Nothing special
--Defeat is temporary but surrender is permanent
--Never say quits
--Jesus is Lord
|
|
|
|
|
I would just cut the string into 1 foot sements so I can easily see both ends. If there is nothing on either end, and no clothespins are clipped in the middle it's an empty see style string.
Walter J. Boncal
|
|
|
|
|
Hey,
how can I manage to print the content of a CRichEditCtrl or a CString containing a rtf-text to an pDC (screen or printer).
Thank you for helping me...
|
|
|
|
|
pDC->DrawText will simply paint normal text on the screen but since you are using rtf-text which means that there can be a lot of things in it, therefore, you have to parse the text first somehow and then paint the things one-by-one. I am sure there will be some libraries which do this. Search here on codeproject.
Regards,
Aamir
|
|
|
|
|
Hello,
I have a dialog app with a menu that allows the user to bring up different windows as they wish. I remember seeing a tutorial/article that had an easy way of placing a check mark next to the menu option that was already selected. (Essentially having the window being displayed already)
Can someone point me to this article.
Currently I am using this code that I had copied way back when(It dies on the first line, even though it works on my older app):
void CMyDialog::CheckMenu(int checked) <br />
{<br />
CMenu* pMainMenu = GetParent()->GetMenu();<br />
<br />
CMenu* pSubmenu = pMainMenu->GetSubMenu(2);<br />
<br />
UINT g = pSubmenu->GetMenuItemID(1); <br />
<br />
CString mnustr;<br />
<br />
pSubmenu->GetMenuString(1, mnustr, MF_BYPOSITION); <br />
<br />
<br />
if (checked) <br />
pSubmenu->ModifyMenu(1, MF_BYPOSITION | MF_STRING | MF_CHECKED, g, mnustr);<br />
else <br />
pSubmenu->ModifyMenu(1, MF_BYPOSITION | MF_STRING | MF_DISABLED, g, mnustr);<br />
}
Thanks!
-- modified at 15:06 Monday 21st November, 2005
|
|
|
|
|
NYTSX wrote: CMenu* pMainMenu = GetParent()->GetMenu();
What does GetParent returns ?
is your application a normal MDI/SDI application ? or is it dialog based ?
If it's the former, you will need to add a handler for the ON_UPDATE_COMMAND_UI and do something like
void CMainFrame::OnMyHandle( CCmdUI* pCmdUI )
{
pCmdUI->SetCheck( checked );
}
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
GetParent throws the error "unhandle exception. Access violation"
This is a dialog based app. The code that I am currently using is from a MDI app that I just called the method with no problems.
Thanks for your help
-- modified at 15:31 Monday 21st November, 2005
|
|
|
|
|
Can anyone help with this? The code I got this from was from a MDI app....but I don't know the changes I need to make to get it to work in a dialog app.
I think the problem is that I am having a problem getting the handle to the menu itself.
The scenario is that I have a main dialog who owns the menu (or so I think) which in turn will instantiate another dialog.
Thanks for your help.
|
|
|
|
|
Hello,
I've got a little problem when I want to debug my DLL. The situation is as follows:
- I've a DLL project and I've buildt a debug version of the DLL with the
PDB file.
- I've another project and I want to test the DLL by calling it's functions
with predefined data. When I hit a application breakpoint, I want to step
into the DLL's code.
- The DLL and the PDB are in the same folder as the test application.
The problem is that VS2005 says that no debug symbols are loaded for the DLL. Is there a way to load those symbols manually, or am I doing something wrong?
Behind every great black man...
... is the police. - Conspiracy brother
Blog[^]
|
|
|
|
|
I have not done any DLL debugging with VS2005 yet, however in the past to get a DLL to step debug I had to start the debugger from the DLL project specifying the EXE that will load the DLL. If you cannot get the EXE to stop at the point you wish, just put an "_asm int 3h" inline and the debugger will stop. If its a debug build it should automatically pull in the source.
|
|
|
|
|
Hello,
Thanks for your reply. I think that MS changed the way the DLL's are debugged. I can't get the source, even with the __asm int 3 jump in the debugger hack...
Behind every great black man...
... is the police. - Conspiracy brother
Blog[^]
|
|
|
|
|
Bob Stanneveld wrote: The DLL and the PDB are in the same folder as the test application.
Are they in the directory for the test applications project or are they located in the Debug sub-directory? If I remember correctly they should be in the Debug sub-directory.
Chris Meech
I am Canadian. [heard in a local bar]
Remember that in Texas, Gun Control is hitting what you aim at. [Richard Stringer]
Nice sig! [Tim Deveaux on Matt Newman's sig with a quote from me]
|
|
|
|
|
Hello,
The DLL, PDB file and the test application are all in the same directory, but to no avail... The debug output shows that the symbols are loaded however..
Behind every great black man...
... is the police. - Conspiracy brother
Blog[^]
|
|
|
|
|
there are two ways i handle this:
1. put the DLL project into the same solution/workspace as your app, build the DLL and the app. then the debugger will know how to find the DLL source.
or
2. in your DLL project, set your test app as the startup EXE . then when you 'run' the DLL, it will start the test app, and you can put breakpoints in the DLL (but not in the test app).
Cleek | Image Toolkits | Thumbnail maker
|
|
|
|
|
Hello,
Thanks for your reply.
Chris Losinger wrote: 1. put the DLL project into the same solution/workspace as your app, build the DLL and the app. then the debugger will know how to find the DLL source.
The projects are all in the same solution. I even pointed the target directory of the GUI test app to the general debug folder where VS puts all the libraries.
Chris Losinger wrote: 2. in your DLL project, set your test app as the startup EXE . then when you 'run' the DLL, it will start the test app, and you can put breakpoints in the DLL (but not in the test app).
I also did this, but it didn't work. Is this a missing feature in the standard edition?
Behind every great black man...
... is the police. - Conspiracy brother
Blog[^]
|
|
|
|
|
|
I think that it's a missing feature in the standard edition. I think that the content of the debug output window is the output of dr watson. This output says that the debug symbols are loaded, but when I hold the cursor above the DLL breakpoint, the tooltip says that there are no symbols loaded. I have to verify this somehow.
Behind every great black man...
... is the police. - Conspiracy brother
Blog[^]
|
|
|
|
|
I am a student majoring in computer science. I have a senior project that I am trying to complete.. and I am looking for help... I have to put together a project that Counts the number of page faults during Least Recently Used and Firt In First out.. I am not sure how to implement those two together to count the page faults... there is no set pages so I created a data file for a sample test.. I have some code for LRU but it's not what my teacher wants.. could anyone help me combine those algorithm if's it's possible. otherwise I will have to do them individually. I am looking for some starting point..
|
|
|
|
|
standard C++ have a big template library which already implements these two concepts...
see the MSDN for STL containers[^]...
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
Hi,
I have a DLL which was created from VB.net and it works very well with a VB application that using it!
I wonder that can I call and use it from VC++ 6.0 (professional Edition)? I did check some tips to call a DLL ... however, otfen it shows how to use a DLL that created from an MFC (using .dll & .lib)
*) I verify the DLL that created from VB.net, it has the .dll but does not have the .lib ... so I could not try these recommended methods
It is desperate request, does anyone know how to do it?
Many thanks
-- modified at 11:03 Monday 21st November, 2005
|
|
|
|
|
you can't do it within VC++ 6 as it is not Managed C++...
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
|
VB.NET code generates a DLL, but it doesn't use the entry-point format that native code uses. You can't therefore use static linking to link to VB.NET code, nor dynamic linking through LoadLibrary and GetProcAddress.
However, you can use COM to call suitable VB.NET code. The code must be implemented (if I remember correctly) as a class instance method (not Shared or in a Module ), must be Public , and the class must either have no constructor or a default constructor (a Sub New which takes no parameters).
To do this you need to register the .NET assembly for COM Interop. The .NET Framework includes the tool regasm for this purpose. regasm can be made to also generate a type library by passing the /tlb option. You can then use a #import directive in your C++ code to get the compiler to generate the necessary code to call the VB.NET code.
For the Framework to find the assembly at runtime, you must either: generate a strong name for the assembly and place it in the global assembly cache, or use the /codebase switch to regasm .
Stability. What an interesting concept. -- Chris Maunder
|
|
|
|
|
Hi Mike,
Thanks for for the detail explaination, in this case and as you suggested I will use COM instead off DLL from VB.net ... now I remember why COM is much more powerful to use through different platform & programs!
Many thanks
|
|
|
|
|
I have an MFC application that is built around the doc/view architecture. I have written some code to save the view's output to a jpg. We shell execute this program from client applications, but now I, or rather my boss, now wants us to use the doc/view code in a dll so that we can save the view's output to a file directly from a client application.
As an analogy imagine loading up a Scribble file in the scribble tutorial (but as a dll rather than an exe), from a simple win32 application. Once save the scribble code returns the result to the win32 app.
How easy is this to wrap the MFC classes in a dll that simply exports a "C" call to kick off the doc/view stuff load/save stuff and close and return the result to the caller, what do I need to do to kick off the MFC stuff properly?
BBly
|
|
|
|