Answer Questions
Ryno1234 Use of const CString
Hi,Today I have reviewed some code of my team mate. One of the class contains a definition like this const CString BITMAP_FILE_NAME = _T( "res/temp.bmp" ); I suggested use LPCTSTR or const TCHAR* (PTCHAR) instead of CString because it has some more overheads that a normal string literal. So my question is. 1. When a CString defined as const, does it really have some performance over heads 2. At the time of compilation, normally the the value of the const will be place in the code at compile time. For CString and other const object, how it is handling is it replacing the address of the const object As off my knowledge later will be happened. Could you please put some light on this Mike, Thanks alot for ...Show All
UnWiNd How to using Console::Wirte in Form
Hi, I create a VC++ windows form application by using VC++ .Net2003, in the code, I type Console::Write("Hello World"); but i unable to see the Console appear during executing. How to display console in Windows Form You want a console in addition to your win forms Strange - but as you want: http://support.microsoft.com/default.aspx/kb/105305 -- SvenC Check this thread ... here is another way of showing a console only when you need it. This is a C# sample, You can create a windows forms application to handle the case where you need to show a GUI. In case where you would like to show console you need to do the following: // AllocConsole Allocates a new consol ...Show All
Vic02 Explicit Interface Method Implementation
In MC++, I can do the following: - __gc __interface ICloneablePerson { Person* Clone(); }; public __abstract __gc class Person : public ICloneablePerson { private: String* _name; protected: Person() :_name(String::Empty) { } Person(String* name) :_name(name) { } Person(Person* source) :_name(source->_name) { } public: __property String* get_Name() { return _name; } }; public __gc class Student: public Person { private: String* _id; public: Student(void) :Person() { _id = String::Empty; } Student(String* name) :Person(name) { _id = String::Empty; } ...Show All
Scuzzy Strange Error - Please Help
Hi all, I wrote a dll (using a definition file). When I call one of the function within the dll from another application (to test the function), I receive a strange error (Messagebox format): Application.exe - Ordinal Not Found - The ordinal 34 could not be located in the dynamic link library. Note I have linked with the .lib file, have included the header file and copied the .dll file to the application directory. (Note that I'm exporting 34 functions) Can anyone help Thanx Are you absolutely sure the dll can be found in the directory you attempted to open it from I receive this error: DUMPBIN : fatal error LNK1181: cannot open input file 'thedllfile.dll' The 'thedllfile.dll' was just a example I took from what you sai ...Show All
Dark Pontiac CPropertySheet Problem
Hi there I'm working now on some application using CPropertyPage and CPropertySheet, the thing is how to change an action(OnClick for example) of standard buttons(OK, Cancel) on CPropertySheet, maybe with more details, when CPropertySheet creates by DoModal or Create such an bookmarks(tabs) creates and some buttons like OK or Cancel, and my question is how to change action of those buttons from standard action to defined in program one best wishes adrian proszczuk poland This forum is for C++ language issues. There is a newsgroup dedicated to MFC here: http://msdn.microsoft.com/newsgroups/default.aspx dg=microsoft.public.vc.mfc&lang=en&cr=US ...Show All
rchokler error LNK2019: unresolved external symbol
I am using visual studio 2005 express edition and am having trouble linking a tutorial code from a book that I use. I have directx SDK(August 2006) installed with the Microsoft platform SDK. All the lib files are linked properly and I have followed the step to enable win32 applications in visual studio 2005 express. However when I build the code I get 2 LNK2019 errors 1>D3DInit.obj : error LNK2019: unresolved external symbol "int __cdecl d3d::EnterMsgLoop(bool (__cdecl*)(float))" ( EnterMsgLoop@d3d@@YAHP6A_NM@Z@Z ) referenced in function _WinMain@16 1>D3DInit.obj : error LNK2019: unresolved external symbol "bool __cdecl d3d::InitD3D(struct HINSTANCE__ *,int,int,bool,enum _D3DDEVTYPE,struct IDirect3DDevice9 * *)& ...Show All
finialscraps Problem with workspace
Hi friends, I'm in my job and I have the next problem. Every time that I trey compile a workspace, the compiler show me this message error: Unhandled exception in MSDEV.EXE (DEVNBC.PKG): 0x0C0000005: Acces violation. Can you help me please. That's MSVC6. Off topic I'm afraid for any of the forums here. No idea what it does, it sorta resembles .ncb, try renaming your project's .ncb file. Or re-install MSVC6... ...Show All
Cush Copying file trees in a custom build
I have a large number of files which I want to include as part of my build process but which only need to be copied to the output directory in the same relative folder that they're in for the project (ie, if the file is in Documentation/Images/Header.jpg relative to the project then I want to copy it to $(OutputDir)/Documentation/Images/Header.jpg). I can create the custom build steps for these files and manually set their output directories but it's tedious. Instead what I want to do is create a custom build tool which will copy the files from their current project-relative location to the output directory in the same relative location. The problem is I can't seem to come up with a project-relative directory using any of the built-in macr ...Show All
Cla82 Question about const_cast
Here's round two of my silly questions. How come this compiles: ---------------------------------- int main (int argc, char * argv[]) { const int test1 = 5; const int test2 = const_cast<const int &> (test1); return 0; } ---------------------------------- But this does not. ---------------------------------- int main (int argc, char * argv[]) { const int test1 = 5; const int test2 = const_cast<const int> (test1); return 0; } ---------------------------------- Error 1 error C2440: 'const_cast' : cannot convert from 'const int' to 'int' j:\test\main.cpp 4 ---------------------------------- I definitely have the latest version of VC++ Express Edition this time. Suncho wrote: ...Show All
komomomo C++ in VS2005 after 'upgrading' to SP1...
I'm having a lot of trouble with my installation of VisualStudio2005 after upgrading to SP1. It seems that the C++ compiler is now unable to compile any code that #includes either <memory> or <algorithm>. It spews out hundreds of errors - here's a small selection: Error 1 error C3646: 'uninitialized_copy' : unknown override specifier c:\program files\microsoft visual studio 8\vc\include\memory 82 Error 2 error C2091: function returns function c:\program files\microsoft visual studio 8\vc\include\memory 86 Error 3 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int c:\program files\microsoft visual studio 8\vc\include\memory 86 Error 4 error C3646: 'uninitialized_copy' : ...Show All
eTape Adobe\Acrobat 7.0\ActiveX\pdfshell.dll appearing in my executable
During execution under the debugger of the debug configuration of MyOgm, I see the following in the output window. 'MyPgm.exe': Loaded 'C:\Program Files\Adobe\Acrobat 7.0\ActiveX\pdfshell.dll Since I am not using pdf or ActiveX in my program, where did this come from Is VC++ linking it into MyPgm How can I remove it, and all similar baggage Neither the /verbose nor /verbose:lib produces any useful information VoiceOfExperience wrote: pdfshell.dll does not appear as a linker input, either in the project or in my library which it uses. Dependency Walker does not show pdfshell.dll in its list of modules. A quick Google search doesn't turn up anything us ...Show All
norpe Windows Form Question
ive found almost nothing to explain how this can be done so i thought i'd ask here. Im using MS VS 2005 (VC++) and i have made a Windows Form. I know the code for generating the Form and any Objects are stored in Form1.h but i wanted to make another file.h so that Form1.h would only create the main Form and file.h could load up any Objects at run time if called by another function. hope that makes sence, the idea is so that i could use it as a type of subroutine. All i could find was samples for C# or VB and i dont want to use that, i prefer to use VC++. any help would be much appreciated. thank you my form1.h is already massive and becoming hard to find the code i am working on so that is part of the reason i was asking about maki ...Show All
Mark Rendle Private access
Say if we ve certain private methods along with private data members and public methods. other than friend function is thr any other way we access these members(they being private only) directly. its one of the requirements in a project of mine. The real prob comes when accessing function. say we've classes ported to us in .obj format. then going for DMA using pointers is a risky n unreliable job. class x { private: void meth1 ( ) { cout<< "Meth1" ; } void meth2 ( ) { cout<< "meth 2" ; } } ; class xduplicate { public: void virtual meth1 ( ) ; void virtual meth2 ( ) ; } ; main ( ) { x obj; xduplicate *obj1; obj1= ( xduplicate * ) &obj; obj1->meth1 ( ) ; ...Show All
enric vives HOW TO CREAT A DLL IN VC++(6.0)
Hi Can any one tell me, how to create a DLL in VC++ Hello Re: HOW TO CREAT A DLL IN VC++(6.0) Such questions (on VC++ 6.0) are outside the scope of this forum - for the scope of the VC General forum please look at: http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=19445&SiteID=1 For such issues please use an appropriate newsgroup, potentially one at http://msdn.microsoft.com/newsgroups . OTP Thanks Damien ...Show All
Leed3 Getting garbage setting dialog box text
Hi Folks; I'm trying to set the text of a dialog box with SetDlgItemText. As an example I'm trying: SetDlgItemText(hwnd, IDC_F1, "Some text"); where IDC_F1 is defined as the ID for an edit box. What I'm getting is just garbage and I thought maybe it was my font but I've set it do Courier New, size 8 which I thought was pretty standard. Maybe someone could shed some light on my sitation. Try SetDlgItemText(hwnd, IDC_F1, L"Some text"); Yes, of course, that's a good point. But just want to point that CString is also a template class and is not MFC specific (though it's exported from MFCXX.dll). Marius Bancila wrote: This should work. Use the _T(x) macro to wrap the texts. CString text = _T ...Show All
