|
There is not enough information, so I will have to guess.
You have exe client that uses outproc(exe) COM server.
Both client and server have to be build with detailed PDB files.
PDB files should be located in the same directory as exe.
1. Start your client in the debug mode
2. Start second instance of VC.
a. In VC6 use menu Build->Start Debug->Attach to Process
aa. In VC7 use menu Tools->Debug Processes
b. find your COM server process in the list click OK.
c. open your source code and set breakpoints
|
|
|
|
|
Hi Alex,
Thanks for help.
I tried as you have told,Run the client in debug mode than run the server.and then went to vc++ build ->Start Debug ->Attach to process.But i didn't see any processes listed their.I don't know what is wrong?
Please help.
|
|
|
|
|
Hello,
I've a workspace with several projects and I switch between them quite a bit since some of the projects are test cases for the main project. I was wondering if anybody knows if there is an Add-In available which docks a Combobox on a toolbar allowing the user to Set the Active Project Configuration. I'd find it very useful.
Otherwise I'd have a go at writing it myself, although it would be my first add-in. I'm aware that there is a CP article on a library which provides a better interface to the VC6 object model than that which MS provides and I might need it for enumerating the projects in the Workspace. I think the combo box in a toolbar might be the scary part.
Thanks,
John
|
|
|
|
|
Hello again,
I've just realised that I can customise Visual Studio 6 to add the Select Project Configuration combo to a toolbar by dragging the combo which appears in Tools-Customize-Commands-Build.
But I'd still like to select amongst all the projects in the workspace.
Cheers,
John
|
|
|
|
|
Enable "Buid" toobar. It has "Set Active Project" and "Set Active Configuration". You can drag them to other toolbar, if you need it.
Pavel
Sonork 100.15206
|
|
|
|
|
|
Hi all...
thank you for reading.
I tried to overload the new and delete operators,
and it didn't work.
#include <stdio.h>
#include <conio.h>
void * operator new( unsigned int cb );
void operator delete (void * mem);
void main()
{
char * var= new char[8];
if (var)
delete []var;
}
void * operator new( unsigned int cb )
{
printf("allocating...\n");
void *res = NULL;
return res;
}
void operator delete (void * mem)
{
if (mem)
printf("deallocating...\n");
}
and the original new and delete was called;
not mine...
please help
=-=-=-=-=-=-=
The Server
=-=-=-=-=-=-=
|
|
|
|
|
You need to include new.h
The declaration for operator new is:
void *__cdecl operator new(
size_t count
);
not what you have.
A quick search of MSDN for operator new will yield lots of usefull information.
Neville Franks, Author of ED for Windows. Free Trial at www.getsoft.com
|
|
|
|
|
I did what what you like you said...
and that works.
thanks
But can you tell what should I do with constructors and distractors .
thanks for your time.
BTW:
The definition of size_t is
typedef unsigned int size_t;
=-=-=-=-=-=-=-=
The Server
|
|
|
|
|
The_Server wrote:
did what what you like you said...
and that works.
thanks
good.
The_Server wrote:
But can you tell what should I do with constructors and distractors.
I might be able to if you explain what the problem is.
The_Server wrote:
BTW:
The definition of size_t is
typedef unsigned int size_t;
Yes on version x of compiler y for platform z it probably is.
Neville Franks, Author of ED for Windows. Free Trial at www.getsoft.com
|
|
|
|
|
Neville Franks...
Thank you.
Neville Franks wrote:
I might be able to if you explain what the problem is.
It calls the ctors and dtors autometically.
(* Sorry for asking you before chacking *)
But 1 question remaining: Why/How Come automatically?
=-=-=-=-=-=-=-=
:rose The Server
|
|
|
|
|
The_Server wrote:
But 1 question remaining: Why/How Come automatically?
Because that is what the C++ Language spec says operator new does. ie. It allocates memory and then calls the ctor.
"Who deleted my pointer?" may be of interest:
http://www.codeproject.com/debug/newdel.asp[^]
Neville Franks, Author of ED for Windows. Free Trial at www.getsoft.com
|
|
|
|
|
Use what you said, the program crashed...
BuggyMax
|
|
|
|
|
Hi there, this is what you want ...
#include <iostream><br />
<br />
<br />
static void* operator new( unsigned int cb )<br />
{<br />
std::cout << "My new \n";<br />
<br />
return (void*)0;<br />
}<br />
<br />
void __cdecl operator delete(void *p)<br />
{<br />
std::cout << "My delete. \n";<br />
}<br />
<br />
void main()<br />
{<br />
char* p = new char[3];<br />
<br />
delete [] p;<br />
}<br />
<br />
<br />
BuggyMax
|
|
|
|
|
What is the include file? Code posting rule one - Use the Formatting bar.
Why is new static and not __cdecl and delete isn't static but is __cdecl?
According to "More Effective C++" by Scott Meyers, "the first parameter to operator new must always be size_t." MSDN docs also show this.
Neville Franks, Author of ED for Windows. Free Trial at www.getsoft.com
|
|
|
|
|
Neville Franks wrote:
What is the include file? Code posting rule one - Use the Formatting bar.
1) The include file is merely <iostream> , there's no ".H" extension.
Including iostream is just for output strings (cout). For information about the new-styled include, please refer to ISO C++, the third generation of C++ programming language. If you just want to trace into step-by-step without displaying some msg on screen, you don't have to include iostream.
2) Yes I did. I used the "code" formatting (on top of the green face button, " " ). But it seemd make my code red-colored but not well-format...
Neville Franks wrote:
Why is new static and not __cdecl and delete isn't static but is __cdecl?
1) Well, I traced into a normal new operator to look at what the prototype that VC++6 uses in file <new>. I saw it is :
void *__cdecl operator new(size_t) _THROW1(std::bad_alloc);
2) static, inline, and __cdecl are three different things.
You may have already know what static and inline mean.
__cdecl is just a hint to make the compiler know how to deal with the stack and formal arguments.
Default calling convention VC++ uses is __cdecl. But you can change it by finding the setting:
Project - Settings - C/C++ tab - calling conventions.
3) Why void* crashes but static void* runs, ... to tell the truth, I do not know. Just now I looked at some web pages discussing overloading global operator new, all of them say void* . I don't find any talking about void* crashing the program with VC++6.
Maybe the one without "static" runs with your VC++.NET. I do not know. I don't have a VC++7 or 7.1.
4) size_t is just a concept of "number that you count". For example, one variable, two variables, three variables...
Since the basic type of "number that you count" is integer, and there is no such " -1 apple, -2 apples ... ", size_t therefore is defined as "unsigned int"...
BuggyMax
|
|
|
|
|
I'm looking for the functionality that was in Visual c++ 6.0 under 'View->Resource includes' where you could add a resource header and .rc file from a static library that should be linked into the application. I cannot find it anywhere Does anyone know? Thanks.
|
|
|
|
|
I hate it when that happens: search for something a few hours, ask on forums, find it a few minutes later For who wants to know: resource view, right-click on .rc file name, "Resource Includes..."
|
|
|
|
|
Hi
i have a CListCtrl which contains a list of names, but there
are duplicates in them, i need a function to remove them
ne1 ne ideas ???
thanks
si
|
|
|
|
|
something like this:
bool bIdExists = false;<br />
CString strIdListTemp = "";<br />
<br />
<br />
for(int i = 0; i< m_messageList.GetItemCount(); i++)<br />
{<br />
CString strIdList = m_messageList.GetItemText(i, 4); <br />
if( strIdList == m_yourDuplicateStr)<br />
{<br />
strIdListTemp = strIdList;<br />
bIdExists = true;<br />
}<br />
}<br />
<br />
if(bIdExists)<br />
{<br />
CString temp = "";<br />
temp.Format("Str: %s already exists", strIdListTemp);<br />
AfxMessageBox(temp);<br />
}<br />
else<br />
{<br />
}
|
|
|
|
|
Maybe your design dictates differently, but rather than remove them after the fact, why not be proactive and prohibit them from being added in the first place?
|
|
|
|
|
How do you know the file is being opened, you aren't bothing to even test for this or any other errors. STRANGE CODE.
How do you know the file is being written correctly? Have you verified that m_hfDCMedianArray[] contains what you think it contains?
The for() loop isn't displayed correctly. You need to use the pre & code & < & > formatting options when posting.
Neville Franks, Author of ED for Windows. Free Trial at www.getsoft.com
|
|
|
|
|
I have hosted WebBrowser in my application. (CHtmlCtrl).
Sometimes (i can't find out when), but not always, after navigation is complete,
window containing browser is activated and get focus.
How to avoid this activation ?
Thank you
rrrado
|
|
|
|
|
Hello!
I Deveoped a Program.
that program is draw a many object(circle, image, rectangle, text, etc)
i ran that program in debugging mode but that program is stop.
stop code is below...
[Header File]
char text[256];
[CPP File]
void Class::Draw(CDC* pDC)
{
// text have a value. value is "OPEN"
...
...
CString strText = _T("");
strText = text;
int nFind = strText.Find('.'); ===> Run is Stop
...
...
}
but i run that program continuously use a F5 Key.
then that program is run (not have problem...)
i don't know why happened that problem...
|
|
|
|
|
i think problem will be one line above.
char text[] should be TCHAR [] (to work in unicode build).
What does contain text ? is it correctly null terminated string ?
rrrado
|
|
|
|