Similar Threads:
1.dynamic_cast does not work across modules with multiple inheritance (VC2005)
I have a project which has been running well on VC6 for years now, but
now more and more reasons are telling me it's time to upgrade. The
system consists of a largish number of dynamically loaded DLLs which
are accessed in some kind of COM fashion.
I have now ported a core set of these but run into a big problem: RTTI
does not work correctly (=the way I want it to) between DLLs anymore,
which it did in VC6.
My setup is this:
class IBase
{
public:
virtual Foo() = 0;
};
class IDerivedOne : virtual public IBase
{
public:
virtual Bar() = 0;
};
class IDerivedTwo : virtual public IBase
{
public:
virtual Goo() = 0;
};
class Test : public IDerivedOne, public IDerivedTwo
{
public:
Foo();
Bar();
Goo();
};
What I then do is load a module (could be the same executable) where
Test is implemented, get a pointer to a new instance of the object (as
an IBase*) through a class factory and then do a dynamic_cast to
IDerivedOne*. However, the dynamic_cast returns NULL and I can't get it
to understand what I want.
Is this the way it should be or should it give me the pointer I want?
reinterpret_cast does not work either, as a cast to IDerivedOne would
really give me IBase disguised as IDerivedOne, to disastrous results.
Does anyone know how to deal with this? Or do you need more code to see
what's going on?
Thanks for any input
2.dynamic_cast does not work in packages
Hello,
I've stuck with the problem.
I've move some working code from exe to bpl, and now
dynamic_cast does not work in bpl.
meaning it always return NULL
what can be a problem
Dmitry
3.intellisense doe not work in 2005
Greetings,
I have a ~300K long C/C++ code that is developed with visual studio. It is
"clean C" meaning that it can be compiled as either a C or C++ code. It
compiles successfully with gcc (-Wall set), the Portland Group compilers, HP
cc, and 2003 and 2005 versions of visual studio.
Intellisense stopped working a few weeks ago and nothing has gotten it back.
The problem is specific to VS 2005, it still works in 2003. I have deleted
the ncb file and recompiled, and have even created a new project. No joy.
The following are true:
===================================================
the code is very close to the ansi standard for C and compiles as C++.
Intellisense in 2005 fails when treated as either C and C++
the code has been compiled with several different compilers, and passes PC
Lint cleanly. It is highly unlikely that language errors are present.
intellisense works in VS 2003, but not 2005
if i remove most source files but leave all the header files in the project,
intellisense works.in 2005.
removing the ncb file and recompiling does not help.
===================================================
This sounds like a bug in 2005. I would hate to have to move back to 2003
to get intellisense back. Any ideas what to do?
thanks,
Gary
4.Cstring WriteString not working also write not working
Hi I am trying to cahnge one line in a TXT file (log file of my application),
the TXT file already include many line and i try to recognize the line i
need and then update it with the string i need,
But WriteString looks like it finish fine no fail,
But the TXT file doesn't change .
Here is the code:
CString readLine,CompareResultFile="c:\a.txt";//the file path is just an
example
CStdioFile LogFile_CStdioFile;
char * full_Log_file_path= (char*)malloc (_MAX_PATH);
int numLines=0;
TCHAR PASS_test[] = _T("Result: PASS");
TCHAR FAIL_test[] = _T("Result: FAIL");
if (!LogFile_CStdioFile.Open(CompareResultFile, CFile::modeReadWrite ))
{
return FALSE;
}
while(LogFile_CStdioFile.ReadString(readLine) )
{
sprintf(full_Log_file_path,"%S",readLine.GetBuffer(0));
if(strncmp(full_Log_file_path,"Result:",7))
{
numLines++;
continue;
}
else
{
if(Status)
{
LogFile_CStdioFile.WriteString(PASS_test);
}
else
{
LogFile_CStdioFile.WriteString(FAIL_test);
}
break;
}
}
LogFile_CStdioFile.Close();
I need suggestion what is the best way to update one line?
5.OutputDebugString not working in VC2005 (was "not working in plain C++ app")
Ok, I have a little more information. (The app I'm using to test with is
just a plain, App-Wizard created app.)
* If I run the app w/o the debugger then I can see the OutputDebugString
statements in DebugView.
* If I run the app w/o the debugger and then attach to the process using
VC6.0 I can see the OutputDebugString output, too.
* If I run the app w/o the debugger and then attach to the process using VS
2005 I can NOT see the OutputDebugString output.
So, clearly the OutputDebugString calls are working but for some reason VS
2005 is not showing them properly.
Microsoft Visual Studio 2005 Version 8.0.50727.42 (RTM.050727-4200)
With this new information, does anyone have any hints or suggestions?
Thanks!
Chris
"Chris" < XXXX@XXXXX.COM > wrote in message
news:f8Hjg.24398$ XXXX@XXXXX.COM ...
> I'm using VS 2005 and am fairly new to it. I knew VS6.0 like the back of
> my hand....
> I've created a Win32 console app using the App wizard w/ default values to
> work with some code I was previously working with in 6.0. However, none
> my OutputDebugString statements (and thus my TRACEs) are printing to the
> Output window. I can't find any docs that say why or why not. Any hints
> or things to check? I'm really banging my head against this....
>
> Below is a sample run from my app SDKBase.exe. If it were running under
> 6.0 it would be littered with TRACE statements. What's so different (or
> turned off by default) in VS2005 so as to make my TRACEs not appear?
>
> Any help would be *really* appreciated.
> Chris
>
>
> 'SDKBase.exe': Loaded
> 'D:\projects\covipc\Support\SDKBase\debug\SDKBase.exe', Symbols loaded.
> 'SDKBase.exe': Loaded 'C:\WINDOWS\system32\ntdll.dll', Exports loaded.
> 'SDKBase.exe': Loaded 'C:\WINDOWS\system32\kernel32.dll', Exports loaded.
> 'SDKBase.exe': Loaded
> 'C:\WINDOWS\WinSxS\x86_Microsoft.VC80.DebugMFC_1fc8b3b9a1e18e3b_8.0.50727.42_x-ww_c8452471\mfc80d.dll',
> Symbols loaded.
> 'SDKBase.exe': Loaded
> 'C:\WINDOWS\WinSxS\x86_Microsoft.VC80.DebugCRT_1fc8b3b9a1e18e3b_8.0.50727.42_x-ww_f75eb16c\msvcr80d.dll',
> Symbols loaded.
> 'SDKBase.exe': Loaded 'C:\WINDOWS\system32\msvcrt.dll', Exports loaded.
> 'SDKBase.exe': Loaded 'C:\WINDOWS\system32\gdi32.dll', Exports loaded.
> 'SDKBase.exe': Loaded 'C:\WINDOWS\system32\user32.dll', Exports loaded.
> 'SDKBase.exe': Loaded 'C:\WINDOWS\system32\shlwapi.dll', Exports loaded.
> 'SDKBase.exe': Loaded 'C:\WINDOWS\system32\advapi32.dll', Exports loaded.
> 'SDKBase.exe': Loaded 'C:\WINDOWS\system32\rpcrt4.dll', Exports loaded.
> 'SDKBase.exe': Loaded 'C:\WINDOWS\system32\ole32.dll', Exports loaded.
> 'SDKBase.exe': Loaded 'C:\WINDOWS\system32\oleaut32.dll', Exports loaded.
> 'SDKBase.exe': Loaded 'C:\WINDOWS\system32\ws2_32.dll', Exports loaded.
> 'SDKBase.exe': Loaded 'C:\WINDOWS\system32\ws2help.dll', Exports loaded.
> 'SDKBase.exe': Loaded 'C:\Program Files\Google\Google Desktop
> Search\GoogleDesktopNetwork3.dll', Exports loaded.
> 'SDKBase.exe': Unloaded 'C:\Program Files\Google\Google Desktop
> Search\GoogleDesktopNetwork3.dll'
> 'SDKBase.exe': Loaded 'C:\WINDOWS\system32\wmfhotfix.dll', Exports loaded.
> 'SDKBase.exe': Loaded
> 'C:\WINDOWS\WinSxS\x86_Microsoft.VC80.MFCLOC_1fc8b3b9a1e18e3b_8.0.50727.42_x-ww_3415f6d0\mfc80ENU.dll',
> Binary was not built with debug information.
> The program '[39368] SDKBase.exe: Native' has exited with code 0 (0x0).
>
>
6. How dynamic_cast works internally?
7. this.Cursor works but not Cursor.Current not working
8. dynamic_cast: 'a' is not a polymorphic type