|
Hi,
I want to know is there a event/notification/method to know that dialog box is initialized. i.e. OnInitDialog() call is finished, dialog box is visible and all controls on it are visible.
Based on this, I need to show a message box depending upon some condition after dialog box is fully intialized. Right now i am able to do it by Setting a timer in OnInitDialog() function with delay of 400 ms. And then in OnTimer, i am able to show the message box depending upont the condition.
Other methods suggested to me are Use PostMessage() inside the OnInitdialog() with some user defined message and in handler i can show message box. But This does not work as it comes in the handler of User defined message before my dialog box is shown.
Please provide your views on this.
Thanks
Prashant
|
|
|
|
|
May be you can try handling CWnd::OnActivateApp..
Regards,
Sandip.
|
|
|
|
|
Have you tried handling WM_SHOWWINDOW message(OnShowWindow ) ?
You just need to keep track of when you want to use it.
|
|
|
|
|
It's very dull, but what I've done in a similar situation is to have a member variable: m_bInitialised.
CMyDialog () : CDialog (blah)
{
...
m_bInitialised = FALSE;
}
BOOL CMyDialog::OnInitDialog ()
{
...
BOOL bReturn = CDialog::OnInitDialog ();
m_bInitialised = TRUE;
return bReturn;
}
Iain.
Codeproject MVP for C++, I can't believe it's for my lounge posts...
|
|
|
|
|
I have three users viz.
User1
User2
User3
User2 has mapped network drive.
Now when i enumerate drives using GetLogicalDrieStrings in User1, i only get drives of User1.
What i want is to enumerate all the drives including mapped drive in User2 in any user context.
How can i acheive this???
Thanks in advance.
Regards,
K. Sushilkumar.
|
|
|
|
|
Mapped drives are maintained per context.
So a mapped network drive of one user may not be valid for another user.
It is also dependent on the user privileges.
So Z: may be mapped by 2 different users on 2 different locations.
«_Superman_»
|
|
|
|
|
Hi,
I have created client and server application that uses
sockets for communication. But only single client can connect to server.
I have to connect multiple clients to same server.
Can anybody help me?
Thanks in Advance
|
|
|
|
|
You will need a multi-threaded program to handle multiple clients.
One dedicated thread will only wait for new client connections and will not do any other processing.
As soon as a client connects, a new thread is created to handle that particular client.
Either this or you can create the server using IO completion ports.
«_Superman_»
|
|
|
|
|
"you can create the server using IO completion ports".
Can you please explain?
|
|
|
|
|
|
I have created separate thread for multiple clients.
In that case also connection failed from more than one client
|
|
|
|
|
It looks like your server is not keeping the wait for the next client. Can you show your server code ? that waits for the next client?
|
|
|
|
|
In server I have derived class from CAsyncSocket and had overrided OnAccept function
I am creating new thread from OnAccept function and wrote send,recieve functionalities inside the thread procedure.I have not added wait in server because OnAccept will be invoked when client tries to connect.
Can u please mention what is the problem??
|
|
|
|
|
Haven't used MFC for sockets sorry.
|
|
|
|
|
Is it possible with winsockets?
|
|
|
|
|
Hi, i have a small problem i have a csharp dll built in VS2005.I have to access the functions from this dll in my VC++ project done in VC 6.0.My VC project is not able to identify my C# namespace and class.I dont get what the problem is. Please do have a look at my c# code and VC Project code and do let me know if im making some mistake.I have also pasted the errors that i am getting. please do help me...i'm not able to understand the problem.
C# code:
using System;
using System.Collections.Generic;
using System.Text;
namespace TestDllCsharp
{
public class Class1
{
public void PrintMessage ()
{
System.Windows.Forms.MessageBox.Show("Test");
}
}
}
VC Project :
#import "TestDllCsharp.tlb"
using namespace TestDllCsharp;
#include <stdio.h>
void main()
{
HRESULT hresult;
CLSID clsid;
CoInitialize(NULL);
hresult=CLSIDFromProgID(OLESTR("TestDllCsharp.Class1"),&clsid);
if (hresult == 0)
{
_Class1 *t;
hresult=CoCreateInstance(clsid,NULL,CLSCTX_INPROC_SERVER,__uuidof(_Class1),(LPVOID *) &t);
t->PrintMessage ();
CoUninitialize();
}
}
I get errors like :
error C2065: '_Class1' : undeclared identifier
error C2065: 't' : undeclared identifier
Thnx in advance.
|
|
|
|
|
You cannot directly access a C# class in VC.
You will need to create a COM Callable Wrapper (CCW) from the C# class.
Look at the documentation on how to create CCWs.
Then you can access it from VC like you access a COM component.
«_Superman_»
|
|
|
|
|
Shouldn't that be Class1 instead of _Class1?
|
|
|
|
|
Hello Friends i am facing a problem of CString Memory Leaks in VC6.0 in the Release mode i need some patches to ovvercome the Error. How to Fix The Bug Without changing my application
Hi this Ravinder
|
|
|
|
|
Neither here nor the other time you asked this question have you given any objective evidence of why you believe there to be leaks in CString . As I stated before, look at your own code - the likelihood of your code being incorrect is much, much higher than the likelihood of the code in MFC being incorrect, especially when it's a version of MFC that's had 11-12 years of exposure.
|
|
|
|
|
I am new to VC++(MFC).. i'm in need to do a project in VC++ 2005 in MFC(MDI).... Our project is a stand alone project with runtime updation of databases also..,Can anyone help me in how to create forms with controls and calling one anotherforms..? I searched in Google .,no use.,help me please..........
Rajesh Kumar
|
|
|
|
|
How much are you ready to pay?
rajesh_kumar wrote: Can anyone help me in how to create forms with controls and calling one anotherforms
yes, good books or specific questions.
rajesh_kumar wrote: I searched in Google .,no us
And you didn't find anything.... READ MSDN
You need to google first, if you have "It's urgent please" mentioned in your question.
_AnShUmAn_
|
|
|
|
|
thank u..... for ur kind help.......!!!!!!
|
|
|
|
|
why don't you try Code Project Desktop Environment Section? you will get very good examples.
All the best
|
|
|
|
|