|
Ah this seems to work!
But im a little confused now.
Isnt it kind of standard to communicate between classes like this:
ClassA.h:
...
#include "ClassA.h"
...
ClassA.cpp:
...
ClassB* pObjB;
pObjB=new ClassA(this);
...
ClassB.h:
...
class ClassA; (<-Problem solving forward reference, instead of include)
class ClassB
{
private:
ClassA* pObjA;
}
...
ClassB.cpp:
...
ClassB::ClassB(ClassA* pObjA)
{
this->pObjA=pObjA;
}
...
pObjA->gimmeSomeClassAMember();
...
|
|
|
|
|
I feel extremely bad for having to ask this, but how do i publish my program in C++ to an executable install to send to my other computer.
|
|
|
|
|
Do you need to an installer?
|
|
|
|
|
well maybe not an installer, but when i put the release file on my other comp it wouldn't work, couldn't find mscores.dll or something to that extent.
|
|
|
|
|
It's called "deployment", and you shouldn't feel bad asking about it.
It can be a fairly complex topic.
Deployment (C++)[^]
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Thanks, alright. I'll start reading and thanks for the reply.
|
|
|
|
|
Sorry to bring this up again, but i cannot figure this out.
It says here:
"The most comprehensive way to determine which DLLs your application depends on is to open the application using the Dependency Walker (depends.exe), which ships with Visual C++. Depends.exe is installed to \Microsoft Visual Studio 2005\Common7\Tools\bin. Note that depends.exe is only installed if you select the Win32 Platform SDK Tool, which is in the Visual C++ Tools category of the Visual C++ custom installation."
But i have Microsoft Visual Studio 9.0\Common7\Tools\ but no bin. I figured out that my program depends on MFC, but i cannot figure out how to continue to publish my program to send to my other computer without having to install Visual Studio's on it.
Is their an article that could help me out with this, i cannot understand the MSDN article explaining it, and the things they point out just don't seem to fit. I'm missing a few items that they have pointed out.
|
|
|
|
|
Hi!
I'm new to multithreading and developing in VC++ 6 directly with the win32 API.
In console mode, the usual code to create another thread and use it runs well in my system, but I have no success when using WinMain, like in the very simple code below:
int globalval;
void __cdecl TestThread( void* param ){ globalval=10; }
int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE,
PSTR szCmdLine, int nCmdShow )
{
globalval = 5;
_beginthread( TestThread, 0, (void*)NULL );
CreateMyWindows(hInstance);
MSG mess;
while( GetMessage(&mess,0,0,0) )
{
TranslateMessage( &mess );
DispatchMessage( &mess );
}
return mess.wParam;
}
I go past the _beginthread call and it even returns a thread number, but apparently TestThread doesn't run at all, because globalval doesn't change. Then after the first call to GetMessage I get the error message "R6016 not enough space for thread data".
Yes, I have VC6 with project set for run-time library "Debugging Multithread".
Any ideas?
Thanks a lot,
Rick Trelles
|
|
|
|
|
Hi All,
I am trying to show a message box with only one button"Cancel".
int MessageBox( HWND hWnd,
LPCTSTR lpText,
LPCTSTR lpCaption,
UINT uType
);
in uType we can give
MB_OK or MB_OKCANCEL.
But I want to have only one button on messagebox ie "Cancel".
how can I get this.
Thanks
..
Sheshidar
|
|
|
|
|
|
Yes but MB_OK is not going to give him Cancel button.
-Saurabh
|
|
|
|
|
I dont think we have MB_CANCEL but I think he can changes title of button.
|
|
|
|
|
After reading MSDN documentation I couldn't find anything. Do you know how to do that?
-Saurabh
|
|
|
|
|
You can get a handle to a messagebox window and then you can change text of it.
|
|
|
|
|
MessageBox is a modal window so it blocks the calling thread. So once you call MessageBox then unless you dismiss it nothing else can be done.
-Saurabh
|
|
|
|
|
I saw my files it was on the C#.
|
|
|
|
|
I hate to do this but it is not going to work in C# as well. System.Windows.Forms.MessageBox mimics MessageBox in windows. So there is no option to use just the Cancel button.
-Saurabh
|
|
|
|
|
Saurabh.Garg wrote: I hate to do this but it is not going to work in C#
Why c# is good I think its easy to learn anyway maybe you like to see Dissecting the MessageBox[^].
|
|
|
|
|
I never asked why C# is good!!! We were talking about MessageBox. I have seen that article and it create a new class for doing custom stuff. It has got nothing to do with MessageBox WinAPI provides.
-Saurabh
|
|
|
|
|
I don't think it is possible with MessabeBox. You can simple create your own dialog and add a single cancel button.
-Saurabh
|
|
|
|
|
Thanks Guys,
I created a new dialog to work with cancel button.
I wanted to try with messagebox only.
Any way thanks for ur replies.
|
|
|
|
|
|
Hello everyone,
I am a chinese.Here,my development envirument is VC.net.In my project i add a FORMVIEW resource(named IDD_FORMVIEW(English (U.S.))).But i find that this FORMVIEW can not display my motherlanguage.Every chinese character comes to be a chaos.
I don't know how to find a IDD_FORMVIEW(Chinese (P.R.C)).And I can't find the properties of FORMVIEW has a "Language" item. I have try my best to solve the problem.But i faild.
Can anybody tell me how to change the FORMVIEW's language?
Thanks!
|
|
|
|
|
No one know?
|
|
|
|
|
I want to format 3 digit numbers as follows
if number is 6 then add "00" before number; SNumber = 006
if number is 15 then add "0" before number; SNumber = 015
CString givenTEXT;
GetDlgItemText(IDC_ID, givenTEXT);
int TEXTvalue = givenTEXT;
CString tempTEXT;
if (TEXTvalue < 10)
{
tempTEXT="00" + TEXTvalue;
}
else if(TEXTvalue < 100)
{
tempTEXT="0" + TEXTvalue;
}
else
{
tempTEXT = TEXTvalue; //error: "=" operator is ambiguous
}
if i change the last line to
tempTEXT = "" + TEXTvalue;
it compiles but tempTEXT is all screw up : "..\include\Atlexcept.h"
|
|
|
|