|
also, you (and the OP) must be aware that printf()-like functions are not thread safe, were C++ xxstream classes are.
|
|
|
|
|
Hello,
I have a class in MFC and I want to use this class in Windows forms. For that I create a .dll file using the MFC class and load that .dll file in to CLR project and draw that object in Windows form. But now I want to add an event to that new control. How can I do this?
eg:
I have a ctreeview in MFC and I create a .dll file using that MFC class and open a CLR project in VC++2008 and add a form to that project and load that .dll file. Then I can access that MFC class in my new Windows form ( in CLR project ). and it is working. But my current problem is that, I want to read selected node value from that tree node to my Windows forms's text entry. How can I do this? I think, for that we need to add an event ( After select ) to that control. But that control is loaded from .dll file.
How can I solve this problem?
Please help me.
|
|
|
|
|
Don't cross post
led mike
|
|
|
|
|
Using Visual C++ 6.0 MFC in SDI application
I typically get confused with the "this" pointer. For example, I created a Dialog Box using Visual C++ 6.0 MFC. Its class has its own .cpp and .h files (Class name for this dialog box is CMyCustomDlg). In the book "Using Visual C++ 6" by Jon Bates and Tim Tompkins on page 219 they talk about Displaying a Modal Dialog Box. They say to declare a dialog class object local to the function handler, such as
CMyCustomDlg dlgMyCustom(this);
//and then display it using
int nRetCode = dlgMyCustom.DoModal();
where CMyCustomDlg is the class name given to this dialog class. I don't understand what is happening here with the "this" pointer with this type of syntax and what the (this) in parenthesis means, and I don't understand where I can use
CMyCustomDlg dlgMyCustom;
int nRetCode = dlgMyCustom.DoModal();
without putting the "this" in parenthesis in the object declaration.
Thanks ahead of time.
|
|
|
|
|
the this in parenthesis is the pointer of the current instance (the meaning of this ) passed as a parameter to the CMyCustomDlg class constructor.
|
|
|
|
|
A pointer to the parent or window owner object that is being passed to the constructor of the dialog. If it is NULL [default value], the dialog objects parent window is set to the main application window.
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
I use following code but can't get the property of docx file
hr = ::StgOpenStorageEx(wcFilename, STGM_READ | STGM_SHARE_EXCLUSIVE, STGFMT_ANY,
0, NULL, 0, IID_IPropertySetStorage, (void**)&pPropSetStg);
hr = pPropSetStg->Open(FMTID_SummaryInformation,
STGM_READ | STGM_SHARE_EXCLUSIVE, &pPropStg);
hr = pPropStg->ReadMultiple(nPidsi, pPropSpec, pPropVar);
|
|
|
|
|
Member 4354119 wrote: I use following code but can't get the property of docx file
So what's failing?
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Hi all!
I have a problem when i initialize class members.
The class is:
class NAME
{
private:
int a;
int b;
BYTE bs1[480];
BYTE bs2[480];
public:
// FUNCTIONS
NAME();
~NAME();
}
in CPP file:
NAME::NAME():a(0),b(0)
{
memset(bs1, "", sizeof(BYTE)*480) // This run well when debugging
memset(bs2, "", sizeof(BYTE)*480) // Here crashes???
}
Can anyone tell me why it crashes in the second memset?
Thanks!
|
|
|
|
|
memset(bs2, "", sizeof(BYTE)*480)
why "" ?
just change to this :
memset(bs2, 0, sizeof(BYTE)*480)
|
|
|
|
|
Dennis L wrote: memset(bs1, "", sizeof(BYTE)*480) // This run well when debugging
memset(bs2, "", sizeof(BYTE)*480) // Here crashes???
should be
memset(bs1, '\0', sizeof(bs1));
memset(bs2, '\0', sizeof(bs2));
BTW, possibly you should use some symbolic name for the buffer size, for instance
class NAME
{
private:
static const int SIZE = 480;
BYTE bs1[SIZE];
BYTE bs2[SIZE];
}
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
Thanks for your reply! I'll check it
|
|
|
|
|
Is there any code for asyncronous connection using wininet except the two 1)[^]2)[^]??
or any reference so that i implement the same
Thanks in advance
Yes U Can ...If U Can ,Dream it , U can do it ...ICAN
|
|
|
|
|
I want toread the text, result of a command at the command prompt. Is there a way other than redirecting it to a text file. My command shows some timely status on the window.
Thank you.
Saadhinchaali
|
|
|
|
|
use std::cin class to read from the input stream
|
|
|
|
|
toxcct wrote: std::cin
Thank you but I dont think it will help. Ok i will explain the total case.
I have a batch file which contains a call to an exe file called "checkstat.exe". By executing this exe through that batch file, a console window comes, and the result of 10 lines is shown on the console at first. Late after 3-4 seconds again 4 lines are shown on the console. With some intervals of 3-4 seconds some lines are shown like that until we press ctrl+c. I am running the batch file from my application using
system("");
I want all the lines which are shown on the console until the ctrl+c into some buffer in my application.
Thank you
Saadhinchaali
|
|
|
|
|
|
See here.
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
|
Hi,
what microsoft api's need to be used for playing audio on pc from phones that are paired with the pc via bluetooth. in VC++.
Thnaks.
|
|
|
|
|
Hi Dear
,,,,,,just tell the answer of this question,in c++ programming where to use inline function ,macro and constant .
2-why we use iterator in stl ,but why can not use pointer.
3-how i can hide my class from other user as they derived from my class and still they can use my private data but can not see my class variable.
|
|
|
|
|
if you know what these are, you should be able to get the answer for "where to use", "why it is so", "how i can"; other wise you are not fit for the job where you were asked this question.
|
|
|
|
|
I don't know why you're asking these ; it sounds like questions for a quite advanced C++ programmer, but still you can't answer them ?
anywayz :
1) you use inline functions whenever you want the function call to be replaced by its body. it saves the time of a function call, by which datas are passed through the call stack, but increases the size of your application. note that the telling a function to be inline will not always make it inlined. it's up to the compiler to decide of the complexity, then inline or not.
2) all the STL containers don't have contiguous elements, that's why simple pointers cannot work on the STL. BTW, iterators are defined to work as easy as pointers on their containers.
3) if you want a class to be final (not inheritable), make its constructors private...
|
|
|
|
|
Hi,
I have DllObjectDrawRuntime function defined in wwlib.lib. I successfully compiled the lib. I included the .h file in another project and using the function DllObjectDrawRuntime in one file. but on go to definition it is saying symbol undefined. I have another function DllObjectDraw in another file in the same wwlib.lib. and I am successfully calling that.
Any help is appreciated
Regards
|
|
|
|
|
subramanyeswari wrote: DllObjectDrawRuntime
How did you export that symbol?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|