|
See here[^] Im not sure its helpful for you or no?
|
|
|
|
|
|
Dennis L wrote: My teacher has told me this project is going to be published with no fee in the internet.
Not really a programming answer, but this seems a bit wrong to me. Surely this is work that you will create - it's valid for your teacher to mark it, and maybe keep confidential copies for reference in case someone challenges her marks - but why does she have a right to give your work to the world?
If *you* allowed it to be published to the world, then great. I've written some articles here, and am happy to give back to the greater community. But I'd be peeved if I had no choice about it.
Would you fail if you handed in the code with "Copyright Dennis L, not GPL, not using GPL, and not to be published without permission" on the top of every page?
Saying that, if you use GPL components, their license will infect your code too, I suppose.
Iain.
Plz sir... CPallini CPallini abuz drugz, plz plz help urgent.
|
|
|
|
|
I have problems compiling my project.
There a two header-files:
the first one, ClassA.h:
#include "ClassB.h"
class ClassA
{
...
private:
ClassB classB;
...
}
and the second, ClassB.h:
#include "ClassA.h"
class ClassB
{
...
private:
ClassA classA;
...
}
So ClassA requires ClassB and ClassB requires ClassA.
The Compiler doesnt semm to like this kind of cross-requirements.
How can i solve this problem?
|
|
|
|
|
The way you're going about things doesn't make sense if you think about it. If Class A contains an instance of Class B and Class B contains an instance of Class A you've got something akin to infinite recursion. Perhaps this diagram will clarify this:
Class A
{
Class B
{
Class A
{
Class B
{
Class A
{
.
.
.
}
}
}
}
}
Steve
|
|
|
|
|
Why vote down this you clowns? This post explains why the approach doesn't make sense and the next suggests a solution.
Steve
|
|
|
|
|
"Vote me down, and I shall become more popular than you can imagine!"
Maybe the thought of an infinite struct blew their minds?
Iain.
Plz sir... CPallini CPallini abuz drugz, plz plz help urgent.
|
|
|
|
|
Perhaps something like this is what you're after:
In "ClassA.h":
class B;
class A
{
...
private:
ClassB &classB;
};
In "ClassB.h":
class A;
class B
{
...
private:
ClassA &classA;
};
Steve
|
|
|
|
|
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
|
|
|
|