|
I'm silly guy , I've just changed the system language and it works.
In that way, all the controls can show text in russian.
.... I'm furious!.
Bye.
Demian.
|
|
|
|
|
Is it possible to have a class instantiate a second class in it's constructor by passing a "this" pointer to the second class? And then have the second class hold and use the pointer to the first class? I believe this is causing a circular dependency and I don't know how to get around it. In other words, class A includes a header file for class B. Class A then instantiates a new class B in its constructor like this: B* classB = new B(this). Class B then needs to include the header file for class A so that it can hold a pointer to it and call functions on it via this pointer. I've tried using forward declarations, but I get an error saying that class so-and-so is undefined. Is there any way to do this or do I need to rethink my code?
|
|
|
|
|
yes.
bisquic wrote:
class A includes a header file for class B.
no, never include B in A ...
do something like :
class B;
class A
{
A( B* pPointerToClassB );
B* m_pPointerToClassB;
}
#include "b.h"
A::A( B* pPointerToClassB ) : m_pPointerToClassB( pPointerToClassB )
{
}
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
Thanks for the quick response. I'm a bit confused though. You said never to include B in A, but in the second code example you are doing just that, no? Also, let me clarify, I want A to create a class B, and then for B to be able to hold a pointer back to A. So in the end, they should both be able to call functions on each other.
|
|
|
|
|
You dont need to include B in A, just declared B as being a class in order to let A to hold a pointer member of type B
#include b sould be replaced by #include a
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
yes, but I don't include it in the header file of class A.
to continue with your clarifications ...
class B;
class A
{
A();
B* m_pB;
}
#include "b.h"
A::A( )
{
m_pB = new B( this );
}
class A;
class B
{
B( A* pA );
A* m_pA;
};
#include "a.h"
B::B( A* pA ) : m_pA( pA )
{
}
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
Ah ha! That did the trick. Thanks so much! I've been trying to get this to work for hours now. So the trick is to use a forward declaration in the header and then include the other header in the implementation. Not quite sure what the difference is there, but I sure am happy it works. Thanks again, you just cleared up a big headache for me
|
|
|
|
|
I'm pretty sure that using this in a constructor is asking for trouble (in the same way it's asking for trouble to use virtual functions belonging to the class in it's constructor).
What happens when class B chucks your (A) this pointer to some other object that already exists, and then the A::A() constructor throws an exception? Your A object doesn't exist, but you have a pointer to where it's partially constructed remains might be, which you'll almost certainly try to use
Ian Darling
"The trouble with the world is that the stupid are cocksure and the intelligent are full of doubt." - Bertrand Russell
|
|
|
|
|
Hi everybody.
I am written an application that support text in russian. How can I make the edit box shows text in russian when the user write in that language?.
I want unicode support for every control, but I don't know how to do that.
Thank you in advance.
Regards.
Demian.
|
|
|
|
|
switch to Unicode in your project settings.
there are APIs for both ansi and unicode, and e.g. SetWindowText is defined as SetWindowTextA with ansi and SetWindowTextW with unicode!
Don't try it, just do it!
|
|
|
|
|
in the projectsettings->C/C++ tab add _UNICODE,UNICODE to other defines.
MSN Messenger.
prakashnadar@msn.com
|
|
|
|
|
in the projectsettings->C/C++ tab add _UNICODE,UNICODE to other defines.
MSN Messenger.
prakashnadar@msn.com
|
|
|
|
|
i have to show a dynamic graph layout, and it must be interactive and rearranged everytime an user insert or delete a determinate node... The application may be similar to Touchgraph (www.touchgraph.com) or kaon (http://kaon.semanticweb.org/demos). The problem is that i must create the application with some C++ library instead that java. Do you some idea? Do you know some library, some examples or some free C++ sourcecode witche may help me???
Sorry for my english, Bye, thanks!
|
|
|
|
|
for your requirement GDI/GDI+ will suffice. checkout how to draw line, circles etc for your graph requirement.
MSN Messenger.
prakashnadar@msn.com
|
|
|
|
|
Hi, I have a set of radio box in my a group box.
I could not set any of the radio buttons.
the member variable is of type int.
I try to set it using m_membervariable = 0 and so on.
Thanks,
Deepak Samuel.
|
|
|
|
|
Deepak Samuel wrote:
m_membervariable = 0
Have you called UpdateData() for your changes to be reflected
on your dialog/sheet?
Also make sure that your radio buttons are tab sequential.
I Dream of Absolute Zero
|
|
|
|
|
Forget about using UpdateData() . Assign each of the radio button controls to a CButton member variable. Then just call SetCheck() accordingly. If you want to operate on a group of radio buttons, just use CWnd::CheckRadioButton() .
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
I want to know how does a project work. I mean I want to know the relationships between the files. How do the files include each other? And what are .obj files?
|
|
|
|
|
Anonymous wrote:
I want to know how does a project work. I mean I want to know the relationships between the files.
I suppose the top-level file in a project is the .dsp file. This text file is similar to the older .mak files, in that it lists what source files belong to the project and how to compile them.
While it's hardly a requirement, most .c and .cpp files have a coresponding .h (or .hpp) file. Any piece of code that wishes to use something located in another .c or .cpp file must #include the coresponding .h (or .hpp) file. At the very least, a forward declaration is required.
Anonymous wrote:
How do the files include each other?
The #include preprocessor directive.
Anonymous wrote:
And what are .obj files?
They are what the compiler creates from the source files. The .obj files are then "fed" to the linker.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
oh no,
project file is no a makefile !! the joke is that the makefile are temporary created files at compile time... if you want to see what is in it, do (under Visual C++ 6) : Project/Export makefile... then follow the Dialog box...
TOXCCT >>> GEII power
|
|
|
|
|
toxcct wrote:
project file is no a makefile
Nowhere did I say that a project file was a makefile. I said the former was like the latter, in that it contained the files comprising the project and how to build them. It was not implied that one could use cl.exe with a .mak file. However, you can use msdev.exe with a .dsp (or .dsw) file.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
This forum is for asking concrete questions, if you want to learn how the c++ language works, then you have to do it somewhere else!
Don't try it, just do it!
|
|
|
|
|
I'm trying to localize a Windows installer package (.msi) built with VS.net 2003. I followed the steps written in MSDN.
However, only the "Preparing to install" dialog is displayed in the localized language, the rest of the installer is still in English. The language/codepage ID's seem to be OK, the localized strings are also in the MSI. (I'm using an English Windows but it should not be the problem as the "Preparing to install" dialog is localized and other programs can also use localized installers.)
Have anyone ever met this problem? Any tips?
|
|
|
|
|
I'm trying to get a very basic Client-Sever app using sockets to communicate (Below are the code snipets). First I start the server, it connects to port 6001 and waits. The client starts up and connects and sends a string, the server accepts the connection and tries to read data into dwValue but I get nothing - they do not communicate after the connection, any ideas why ??
Thanks in advance !!
------------
Server Code:
m_sockRecv = new CSocket;
CString dwValue;
CSocket sockSrv;
sockSrv.Create(6001);
sockSrv.Listen();
CSocket sockRecv;
sockSrv.Accept(sockRecv);
CSocketFile file(&sockRecv);
CArchive arIn(&file, CArchive::load);
CArchive arOut(&file, CArchive::store);
arIn >> dwValue;
Client Code:
CString str = "9";
csocket.Create();
csocket.Connect("localhost",6001);
CSocketFile file(&csocket);
CArchive arIn(&file,CArchive::load);
CArchive arOut(&file,CArchive::store);
arOut << str;
|
|
|
|
|
Could someone possibly explain how the bitmask "mask" property of the LVITEM structure works?
typedef struct _LVITEM {
UINT mask;
int iItem;
int iSubItem;
UINT state;
UINT stateMask;
LPTSTR pszText;
int cchTextMax;
int iImage;
LPARAM lParam;
#if (_WIN32_IE >= 0x0300)
int iIndent;
#endif
} LVITEM, FAR *LPLVITEM; I'm trying to do something similar in my program, but I can't figure out how the LVIF_* flags work to denote which fields are valid and which are not. Any help or points in the correct direction are very appreciated. Thanks.
- Aaron
|
|
|
|