|
Please reply to victor.volkman@eds.com
Is there any way to compile part of a project with VC6 and part
of a project with VC7? We are suspecting a code generation bug
and it would help alot if we could pick and choose which source
files to compile with either compiler. Both compilers are
already installed and coexisting physically.
If we build an all-VC6 project and compile only a single file
with VC7, we get a linker error like this:
surf.lib(srferr.obj) : error LNK2019: unresolved external symbol "__declspec(dll
import) private: void __thiscall std::basic_string<char,struct std::char_traits<
char="">,class std::allocator<char> >::_Copy(unsigned int)" (__imp_?_Copy@?$basic_s
tring@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AAEXI@Z) referenced in funct
ion _SurfsGetCloudNorms
surf.lib(srferr.obj) : error LNK2019: unresolved external symbol "__declspec(dll
import) void __cdecl std::_Xlen(void)" (__imp_?_Xlen@std@@YAXXZ) referenced in f
unction _SurfsGetCloudNorms
..\..\bin\iw\imageware.exe : fatal error LNK1120
|
|
|
|
|
i think the STL has changed enough between the two versions that you can't link .obj or .libs from one to the other.
-c
Be very, very careful what you put into that head, because you will never, ever get it out. --Thomas Cardinal Wolsey
|
|
|
|
|
victor.volkman@sdrc.com wrote:
Is there any way to compile part of a project with VC6 and part
of a project with VC7?
Yes, but almost exclusively if you use C linkage. Debug info, name mangling and especially the standard C++ library has changed enough to make it completely link-incompatible.
We are suspecting a code generation bug
Let me guess... Floating point code?
VC7 has quite a few documented bugs. You might want to search the archives for microsoft.public.vc.language to see if it's not something already known.
Another idea might be to tell the compiler to also generate assembly code (or even debugging in combined source/assembly) to see if the code generated is wrong or not.
++luck;
|
|
|
|
|
Anybody know how to work this thing? I have a project (an .exe) which calls a bunch of calculations that are performed in a .dll. I've got profiling working for the project, but it is only reporting info for functions declared in the .exe. I don't get any info for functions that are in the .dll.
Thanks in advance for any tips.
|
|
|
|
|
Hello!
Does anyone know about any sort of a utility program that can find and delete all the unused resources (bitmaps, dialogs, strings..) that have been left in the project, since everyone forgot about them?
Perhaps an add-in to the Visual Studio, or something...?
Thanks in advance!
|
|
|
|
|
|
nope, that not it, those only remove temporary files from disk ( .obj, ... )
but this[^] might help.
but I haven't found something yet that does the work; I usually take a few hours here and there browing the resource.h file and the .rc file to clean up unused resources.
Max.
|
|
|
|
|
Maximilien wrote:
nope, that not it
Yep, you're right, i mixed up two different problems.
I guess it's time to finally start the clean up of my last project resource files...
rechi
|
|
|
|
|
Thank you very much guys!
The prog you talked about is also quite useful, but as you said, it did not seem to solve the problem I had mentioned.
|
|
|
|
|
In the OnInitDialog I do a MoveWindow (top, left, width, height) if a certain flag is set. Otherwise the default positioning happens. How exactly does Windows decide where to spawn the CDialog by default from my MDI view class? It doesnt always show up automatically at the same place each time I start afresh.
Appreciate your help,
ns
|
|
|
|
|
Sorry it's me again...
In MDI project, how can i detect there is no child window(they are all closed).
because i want to Disable a combobox when there is no child window.
thx in advance.
|
|
|
|
|
jeremysay wrote:
Sorry it's me again.
Don't worry ... it's also me again
.. and it's only a try, but a call to MDIGetActive should return NULL if there aren't any open windows left.
|
|
|
|
|
Schlaubi wrote:
it's also me again
fortunately you are here !!!
so..it works perfectly
once again your solution IS the solution !!
thx !!
|
|
|
|
|
i have a thread that is going to keep attention to a variable, once something is changed in the variable it has to respond to it. So this is how my code looks now:
<br />
BOOL SomeVariable;<br />
<br />
UINT WatchThread(LPVOID param)<br />
{<br />
while (TRUE)<br />
{<br />
if (SomeVariable)<br />
{<br />
break;<br />
}<br />
}<br />
}<br />
<br />
.....<br />
<br />
AfxBeginThread(WatchThread, (LPVOID *)this, THREAD_PRIORITY_NORMAL);<br />
<br />
.....<br />
if i run this my program will need 100% processor usage. how can i prevent this? Make a Blocking function of "SomeVariable"? and how?
[]D [] []D []
|
|
|
|
|
I think you should perhaps insert a Sleep command inside your thread for not to consume so much processor power. Beside that, I don't know whether your thread-solution is the most practible one when waiting for a variable to change. Perhaps you could work with events and one of the wait functions (like WaitForSingleObject), setting the event when your computations have finished (take care: in that case your computation should be placed inside the thread because the wait function is blocking)
|
|
|
|
|
Spinning in a tight loop waiting for a variable to change is not the proper way to notify a thread to begin doing something. Read up on thread synchronization techniques; events and semaphores and the method WaitForSingleObject. If you must do it the way you've described, put a tiny sleep (Sleep(10)) in your while loop.
Ron Ward
|
|
|
|
|
the reason why i want it to be a blocking process is because i want to recreate the windows messaging device, so make my own messagelist. this list will be read by a procedure for the control of a database. i wanted to make the function that reads the messagelist like the function recv (for network communication), the function recv lockes up the while loop until it has received information.
i hope that something like this is possible...
[]D [] []D []
|
|
|
|
|
i don't really get what ur doing but maybe this is sort of what u are looking for?
UINT WatchThread(LPVOID param)
{
while(1){
myclass* pthis = (myclass*)param;
int nmsg = pthis->getMsg();
// do something here
}
}
int cmyclass::getMsg(){
::WaitForSingleObject( _event, INFINITE);
return _msgNumber;
}
void myclass::setMsg( int nmsg)
{
// lock a critical section or use whatever synchronization needed
_msgNumber = nmsg;
SetEvent( _event);
// unlock the critical section or whatever
}
"No matter where you go, there your are..." - Buckaoo Banzi
-pete
|
|
|
|
|
There are several solutions. One solution is an event kernel object and WaitForSingleObject(). Use ::SetEvent() and ::ResetEvent() to signal the object.
Kuphryn
|
|
|
|
|
I would like to do a drag and drop from a file to my dialog window to have the path and the name of the file. How can I do that as simply as possible?
Thanks!
Beginner developer
|
|
|
|
|
Call DragAcceptFiles() in OnInitDialog.
Then implement OnDropFiles - to handle WM_DROPFILES messages - making calls to DragQueryFile and DragFinish as documented.
rechi
|
|
|
|
|
Thanks!
Do you have an example?
Thank you again!
|
|
|
|
|
Modify the header file:
afx_msg void OnDropFiles( HDROP hDropInfo );
DECLARE_MESSAGE_MAP()
And the .cpp here:
ON_WM_DROPFILES()
and here
void CDialogDlg::OnDropFiles( HDROP hDropInfo )
{
char sz[MAX_PATH];
CString szMan;
UINT nFiles=DragQueryFile(hDropInfo, 0xFFFFFFFF, NULL, 0);
for (int i=0; i<nFiles; i++)
{
DragQueryFile(hDropInfo, i, sz, MAX_PATH);
szMan+=(CString(sz)+"\n");
}
DragFinish(hDropInfo);
AfxMessageBox(szMan);
}
rechi
|
|
|
|
|
How can I prevent my application from showing in the taskbar - I mean when running in a normal window (or maximized), I don't want it to appear in the taskbar area.
|
|
|
|
|
Hello, maters please help me.
In my VC++ code, in a dll, I defined a function which looks somewhat like
void *comport_read()
{
BYTE *pData;
....
pData = new BYTE[size];
....
return pData
}
Now func() gets called from a client.
void handler()
{
BYTE *pData;
pData = (BYTE *) func();
...
delete[] pData;
}
When both the DLL and the client are of debug version, errors seem latent.
But when I create them as release verions, memory exception shows up.
The apparently same symptom can be generated such as in the following lines:
BYTE *pData = new BYTE[100];
delete[] pData;
delete[] pData;
So I suspected I could have deleted[] the same pointer to dynamically
allocate memory twice but never find any wrong. Of course the same symptom
doesn't mean the same cause.
I need at least how to tackle this sort of bugging memory problems if
not the exact sotution avaliable.
|
|
|
|