|
Hello all; I have a little problem that's been perplexing me for a bit now. Any help would be greatly appreciated.
Basically, I've written a class library that others can use to write DLL plugins for an application I'm developing. Being the thoughtful guy that I am ( ), I decided it would be nice to allow the writers of these plugins to step into routines in my class library with the Microsoft Visual C++ debugger.
The problem is that it seems the debugging information in the debug version of my library refers to its source files by absolute path - so it's possible to step into them with a debugger, but only if you have the exact same source directory structure as I used to build the library.
So what I'm wondering is, is there an easy way to make it convenient for the users to step into my library at debug-time? Will they be forced to replicate my directory structure, or is there a better way?
I'm using Microsoft Visual C++ 6.
[Insert witty and relevant signature here]
|
|
|
|
|
In my experience, when the IDE can't find a source file in the exact path indicated in the debug info, it prompts where to find the appropriate file. The next files it need to open will then be picked from the same folder.
Another possibility that may work in some situations (e.g.: a small team of developers) is to use mapped network drives as a way to introduce an indirection. I'm not talking about everyone accessing the files through the network, just using the same drive letter.
For example:
Suppose that in your machine, your sources are located starting at:
C:\Projects\Useful\Shared\SuperLibrary
You can create a share for the folder at C:\Projects\Useful\Shared. You don't need to give any permission to anyone but yourself if you don't want.
You can map a network drive, say S:, to the share in your own machine created before.
Then you open the project using the network drive, that is, instead of opening the project at C:\Projects\Useful\Shared\SuperLibrary, you open the one at S:\SuperLibrary (which of course is the same) and build the library. The debug info would then contain references to S:\SuperLibrary instead of C:\Projects\Useful\Shared\SuperLibrary
Now the other developers, can do exactly the same, except that their maps would make S: correspond to another folder share in their own machines, wherever they have copied the sources.
However, I seem to recall this solution does not work if you aren't actually conected to some network.
--
jlr
http://jlamas.blogspot.com/[^]
|
|
|
|
|
That's what I remembered too, but when I tried it, it didn't do anything - it simply skipped over the function I told it to step into. Perhaps I was doing something else wrong; I'll poke into that some more.
The second solution would be a good one, except the API will be exposed to a larger and more general audience - i.e., anyone can download the library and write plugins with it.
Thanks for your suggestions though.
[Insert witty and relevant signature here]
|
|
|
|
|
Mr. Accident wrote:
That's what I remembered too, but when I tried it, it didn't do anything - it simply skipped over the function I told it to step into. Perhaps I was doing something else wrong; I'll poke into that some more.
How are you generating the debug info? If you are generating a PDB file you need to distribute the PDB file too.
--
jlr
http://jlamas.blogspot.com/[^]
|
|
|
|
|
Argh, it's times like these that I feel really silly.
I had the PDB for the main parent application, but I was completely forgetting the PDB for the class library. Not only, that, but I had been specifying the incorrect version of the DLL in the debug settings! That would certainly explain why the debugger didn't bother asking me where the code was.
Thanks very much for your help.
[Insert witty and relevant signature here]
|
|
|
|
|
Hi,
I am doing a project in win32. Sometimes in XP, even after I close the app the process sits there ie. I could see my exe still up in the task manager.
So I want call this ExitProcess() function to force the exe to close.
What parameter should I give to this function. What is the difference between ExitProcess(0) and ExitProcess(1).
Plz someone help.
|
|
|
|
|
The difference is only the exit code, think of it as a returned value similar to a function returning a result. Traditionally 0 means no error occured, -1 might have special meaning, numbers above 0 are other more common errors. If you don't intend to use exit codes in a useful sense, just use 0.
|
|
|
|
|
|
Ann66 wrote:
I am doing a project in win32. Sometimes in XP, even after I close the app the process sits there ie. I could see my exe still up in the task manager.
ExitProces..... Why don't you use WM_QUIT message to close you application....
Ann66 wrote:
I could see my exe still up in the task manager.
Intresting... are you running any loop or you forget to free any com object..... could you tell me what exactly your application doing...
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
A while back i saw a program that was able to capture an image of the entire workspace, i think by utilizing the Print_screen key on the keyboard some how!
I would like to know, how would you go about doing that with c++, and saving that image into a file?
thankz.
|
|
|
|
|
i seem to get this warning on damn near any MFC project i've used on Visual Studio .net
LINK : warning LNK4089: all references to 'OLEAUT32.dll' discarded by /OPT:REF
i looked it up and apparently the linker is decided that i dont need OLEAUT32.dll cause nothing is using it.. but i cant figure out where in the world any part of my project is mentioning OLEAUT32.dll in the first place. so im not sure why the linker thinks i wanted it in the first place
|
|
|
|
|
With many include files, they have a #pragma statement that adds the DLL/LIB as a required DLL/LIB during the link phase.
For example, COMDEF.H includes:
#pragma comment(lib, "oleaut32.lib")
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|
This warning is harmless, and can be ignored if the DLL in question is one of the system DLL's. In that case, a piece of library code (which may have been omitted due to function-level linking) referenced the DLL, and you no longer need it. If the DLL in the message is one of yours, you may want to check.
Software Zen: delete this;
|
|
|
|
|
I am having trouble overiding the default tooltip text that display the tick count in a slider control.
My code is below. Any suggestion is greatly appreciated.
void CGraphView::OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar)
{
static CString strMinutes;
CToolTipCtrl *pTool;
if ((CSliderCtrl*)pScrollBar == &m_Slide &&
(nSBCode == SB_THUMBPOSITION || nSBCode == SB_THUMBTRACK)
)
{
pTool = m_Slide.GetToolTips();
strMinutes = "Test";
pTool->UpdateTipText(strMinutes, this);
pTool->Update();
}
CFormView::OnHScroll(nSBCode, nPos, pScrollBar);
}
Anil
|
|
|
|
|
How can I read each cell from each row in a worksheet. Can some one help me . I have tried it out. I can search a particular string. Also can some1 plz give me a good link for tutorial on it or any other reference
Regards
|
|
|
|
|
Hello All.
I'm a beginner programmer and try to make a simple web browser using C++/MFC. With the help of this site, I managed to started it. I'd like to do the control on VIEW menu (Text Size) to be changed same as in IE. I don't know how can I do it. I'd like to ask some help for the people out there. Please teach/tell me how can I start to do it.
Any help will be much appreciated.
Thanks and more power to this site.
With great power comes a great responsibility.
|
|
|
|
|
babyspidy wrote:
I'm a beginner programmer and try to make a simple web browser using C++/MFC.
So have you see the CHtmlView class?
babyspidy wrote:
I'd like to do the control on VIEW menu (Text Size) to be changed same as in IE.
I'm not exactly sure what this means?
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
Thanks for the reply.
I have seen the CHtmlView class but not quite familiar how it works.
For the View menu found in IE menubar, there's a Text Size option which you can select Largest, Large, Medium, Small, and Smallest for the user to increase/decrease the text size. I want to do this function in my project but I don't know how I will put a function on it.
In my ****View.cpp, I put
ON_COMMAND(IDR_VIEW_LARGEST, .....)
ON_COMMAND(IDR_VIEW_LARGE, .....)
ON_COMMAND(IDR_VIEW_MEDIUM, .....)
ON_COMMAND(IDR_VIEW_SMALL, .....)
ON_COMMAND(IDR_VIEW_SMALLEST, .....)
...
but I don't know how I will implement the function for it. I hope someone knows how to handle those commands..
Thanks again and best regards.
With great power comes a great responsibility
|
|
|
|
|
If you are using CHtmlView, to obtain the current setting, try this:
VARIANT var;
ExecWB(OLECMDID_ZOOM, OLECMDEXECOPT_DONTPROMPTUSER, NULL, &var);
To set a given size, try this:
VARIANT var;
var.vt = VT_I4;
var.lVal = 1;
ExecWB(OLECMDID_ZOOM, OLECMDEXECOPT_DONTPROMPTUSER, &var, NULL);
Hope that helps,
--
jlr
http://jlamas.blogspot.com/[^]
|
|
|
|
|
Thanks for the quick response.
Where I will set the code above.
From MESSAGE_MAP, I made this:
ON_COMMAND(ID_VIEW_LARGEST, CHtmlView::OnViewLargest)
.
.
.
then, I made a function for that using the line you gave and it goes like this.
void CHtmlView::OnViewLargest()
{
/* Assuming the following is in a member function of
a class derived from CHtmlView
*/
VARIANT var;
var.vt = VT_I4;
var.lVal = 4; // 1 means small
ExecWB(OLECMDID_ZOOM, OLECMDEXECOPT_DONTPROMPTUSER, &var, NULL);
}
and so on...
Is this correct?
Sorry for being an ignorant with this matter. I am really a beginner in VC++/MFC Programmer. I hope I can overcome this.
Thanks for your patience guys and for giving some time of yours with this matter. It really helps a lot to me.
With great power comes a great responsibility.
|
|
|
|
|
You are using a view class derived from CHtmlView, right? Then, assuming your class is named CYourView and derived from CHtmlView, the lines in red are what you'd need to add:
class CYourView : public CHtmlView
{
.
.
.
<code>afx_msg void OnViewLargest();</code>
.
.
.
DECLARE_MESSAGE_MAP()
};
BEGIN_MESSAGE_MAP(CYourView, CHtmlView)
<code>ON_COMMAND(ID_VIEW_LARGEST, OnViewLargest)</code>
.
.
.
END_MESSAGE_MAP()
.
.
.
<code>void CYourView::OnViewLargest()
{
VARIANT var;
var.vt = VT_I4;
var.lVal = 4;
ExecWB(OLECMDID_ZOOM, OLECMDEXECOPT_DONTPROMPTUSER, &var, NULL);
}</code>
--
jlr
http://jlamas.blogspot.com/[^]
|
|
|
|
|
Thank you very much Mr. Jose Lamas.
It works now for me.
One more thing, when I click the Small option from the View Menubar, Medium option remains checked. The checked option should be change to Small. The check always remain on Medium option, it never change to the selected Size option.
How can I do that?
Thanks again and I really appreciated your help a lot.
With great power comes a great responsibility.
-- modified at 22:05 Sunday 28th August, 2005
|
|
|
|
|
You need to add ON_UPDATE_COMMAND_UI entries with a handler for each of the options. In each handler, you can call SetRadio on the CCmdUI parameter you receive. The value for SetRadio is TRUE when the current selection (obtained as shown in previous posts) matches the value that correspond to the menu entry for which you are handling the update command message.
For example:
afx_msg void OnUpdateViewTextSize(CCmdUI* pCmdUI);
ON_UPDATE_COMMAND_UI(ID_VIEW_SMALLEST, OnUpdateViewTextSize)
ON_UPDATE_COMMAND_UI(ID_VIEW_SMALL, OnUpdateViewTextSize)
ON_UPDATE_COMMAND_UI(ID_VIEW_MEDIUM, OnUpdateViewTextSize)
ON_UPDATE_COMMAND_UI(ID_VIEW_LARGE, OnUpdateViewTextSize)
ON_UPDATE_COMMAND_UI(ID_VIEW_LARGEST, OnUpdateViewTextSize)
long GetTextSizeFromMenuID(UINT nId)
{
long lVal = 2;
switch (nId)
{
default:
ASSERT(FALSE);
break;
case ID_VIEW_SMALLEST:
lVal = 0;
break;
case ID_VIEW_SMALL:
lVal = 1;
break;
case ID_VIEW_MEDIUM:
lVal = 2;
break;
case ID_VIEW_LARGE:
lVal = 3;
break;
case ID_VIEW_LARGEST:
lVal = 4;
break;
}
return lVal;
}
void CYourView::OnUpdateViewTextSize(CCmdUI* pCmdUI)
{
long lSize = GetTextSizeFromMenuID(pCmdUI->m_nID);
VARIANT var;
ExecWB(OLECMDID_ZOOM, OLECMDEXECOPT_DONTPROMPTUSER, NULL, &var);
pCmdUI->SetRadio(var.vt == VT_I4 && var.lVal == lSize);
}
--
jlr
http://jlamas.blogspot.com/[^]
|
|
|
|
|
Thank you very much Mr. Jose Lamas Rios.
I made it now. It really helps me a lot. I can now continue my project. I really appreciated your help here.
By the way, I would like to ask, is there's a way of showing a html that is within the resources but its not declared in .rc. I have read some forum regarding on CHtmlView using LoadFromResource command but it is necessary that all html files in res should be declared in .rc file. And for using Navigate command, the path or directory of the html file is required. If I used the resource path, still it needs to be declared in .rc. Is it possible to view the html file that is not declared in .rc?
Thanks again and best regards. More power to you Mr. Jose Lamas Rios. You're the man! More blessings for you.
With great power comes a great responsibility.
|
|
|
|
|
Hi,
I am trying to put together a Video Clip organizer for all of my captured AVI file clips.
I need to be able to get it to play the clip so that I can see what it was in order to catalog it, so I went for the "simplest" method using MCIWndCreate() and MCIWndPlay() etc...
Unfortunately when I try this, I get a message; "Video not available: Cannot find 'vids:dvsd' decompressor."
But if I just click the clip in explorer, it plays OK in Windows Media Player (v10)....
I am using Visual Studio.net 2003 on WinXP Professional.
At the same time I am using some AVIFile functions within the program to access various stream information from the file; if this is relevant in any way.
Anyone have any idea why this is happenning, and how to fix it, or is there a better way to get the clip to play?
Thanks,
Bryan.
|
|
|
|
|