|
1. MFC dialog app is created
2. 2nd modeless dialog is created with extended style WS_EX_APPWINDOW, it's then shown and updated. The parent is set to null or desktop with SetParent(NULL) or SetParent(GetDesktopWindow())
3. Main dialog window is minimized, and as it is, the taskbar space for the non-modal disappears and the non-modal dialog is also minimized
4. NO, i repeat NO messages at all are sent to the non-modal dialog such as you would expect (ex. WM_SIZE message).
My Question is simple, what the heck is going on? How does one stop MFC from stealing the non-modal dialog's messages and reducing it automatically and removing it's taskbar space?
So far no one has been able to answer this, and I've posted it a couple times.
hey
|
|
|
|
|
Beer wrote:
So far no one has been able to answer this, and I've posted it a couple times.
Which might be an indication that no one has an answer.
|
|
|
|
|
DavidCrow wrote:
Which might be an indication that no one has an answer
I guess I was secretly hoping somebody was going to pull out their secret MFC internal mapping chart they swiped from the MS complex in Washington and answer this eventually, but alas, it doesn't seem to be happening
hey
|
|
|
|
|
The behaviour you are talking about is by default. To solve the problem you could create your modeless directly as the child of the desktop window. Then you would need to manage the communication between the dialogs wich, i'm afraid, could raise some problems.
rechi
|
|
|
|
|
directly how?
you mean without using a dialog resource, or without using CDialog?
My modeless dialogs are already made with CDialog, and it would be an overhaul to change them.
Is there some way to intercept MFC and selectively stop it's internal message handling?
hey
|
|
|
|
|
Beer wrote:
Is there some way to intercept MFC and selectively stop it's internal message handling?
Theoretically it is possible by intercepting PreTranslateMessage but i don't know if it works in this case.
Beer wrote:
directly how?
Check this sample:
CModelessDlg *pdlg=new CModelessDlg;
CWnd *pMan=new CWnd;
pMan->Attach(::GetDesktopWindow());
pdlg->Create(IDD_DIALOG_MODELESS, pMan);
pMan->Detach();
delete pMan;
pdlg->ModifyStyleEx(0, WS_EX_APPWINDOW);
pdlg->ShowWindow(SW_SHOW);
where CModelessDlg is the CDialog derived. You have to manage the pdlg pointer
rechi
|
|
|
|
|
rechi,
thanks for all your help, apparently it had to be created with the desktop window pointer.
hey
|
|
|
|
|
AHHHH!!!
I finally got it, you have to create the dialog with the desktop as the parent and not set it as the parent later
dlg->Create(IDD_DIALOG, GetDesktopWindow());
Boy do i feel stupid
hey
|
|
|
|
|
Hi,
I'm new to Active Directory... so don't know if what I'm saying it's an stupid thing or can be done easier in some other way...
The idea it's when I launch my application, take the current logging and ask active directory if he is in the group of users that can access to any of the servers database.
If he is in that group, then he can access to a fileshare ( readonly for him), where the application will read from an XML file which is the connection string of the database that he can access ( there are different database depending on the department of the company), so the login process would be automatic. I thought about Active Directory because of security issues, it seems that the network administrator is the only one that can handle the permissions and...
My questions are:
- To retrieve the current user logged in, should I use the API ? It is possible to get it from the Active Directory ?
- How can I add a FileShare to an existing group ?
- Could it be possible to have the connection string information in the Active Directory database instead of in an external file ?
Thank in advance, greetings
Braulio
|
|
|
|
|
I see the tutorial connection to mysql server using vc++ but i dont know how to include mysql++. How to install mysql++ api and how to run it so that i can connect.
lau
|
|
|
|
|
hi there..
i included the MFC Libs in the project .. and the symbols were all linked..
but this came along and that too in hundreds..
error LNK2005: _strncpy already defined in libcd.lib
plz help..thanks
|
|
|
|
|
You are including a lib which already #includes or declares the strncpy (I would bet on a #include<string.h>. Remove that #include from your code.
~RaGE();
|
|
|
|
|
yes got it..
hey one more thing rage..
VCF1Ctl.obj : error LNK2001: unresolved external symbol "public: virtual int __thiscall CVCF1Control::CVCF1ControlFactory::UpdateRegistry(int)" (?UpdateRegistry@CVCF1ControlFactory@CVCF1Control@@UAEHH@Z)
any ideas about this one?
kindest regards
safee
|
|
|
|
|
I use api and I have a question
DialogBox(hInst, MAKEINTRESOURCE(IDD_AUTHORIZATION), main_hwnd, (DLGPROC)authDialog);
where main_hwnd is a handler to the parent window.
But when the dialog box appears it is not shown relatively to the parent window. Relatively I mean at the center. Could you help me how to change the code to set the dialog box at the center of parent window?
|
|
|
|
|
CDialog *pDlg=(CDialog *)GetDlgItem(IDD_AUTHORIZATION);
BOOL bCenter=pDlg->CenterWindow(main_hwnd);
~RaGE();
|
|
|
|
|
OK but I said I use api windows not MFC.
Any suggestions?
|
|
|
|
|
I got this link problem and really don't know why ...
any ideas ?
-----------Configuration: CentralServerTest - Win32 Debug--------------------
Linking...
Network_CS_HackedPeersD.lib(Network_CS_HackedPeers.obj) : error LNK2005: _namespaces already defined in network_testappD.lib(NET_gSoapInterface.obj)
Debug/CentralServerTest.exe : fatal error LNK1169: one or more multiply defined symbols found
Error executing link.exe.
CentralServerTest.exe - 2 error(s), 0 warning(s)
|
|
|
|
|
You must have use in your code a namespace already defined in one of the lib you are trying to link with. Or you are using two libs in which the same namespace is declared.
~RaGE();
|
|
|
|
|
Friends,
I want to load a text file using fstream (or any other standard method). Then i want to search for certain string in a text file. For example i want to find that how many times the word "codeproject" appears in the text file.
Please tell me the efficient method to do so ?? I asking here to have your advices in this regard. Actually i need to implement this in server side application where speed and efficiency are primary requirements.
|
|
|
|
|
Use a memory-mapped file (e.g., CMemFile). Read the file in chunks, and search for text using CString::Find().
|
|
|
|
|
Well,
the idea is not to compare words but characters and implement something
as state machine.
For the word "codeproject" you expect for 'c'.
if the read character equals to 'c' then you know that you expect for 'o'.
If the read character is not 'o' then you return back to expect for 'c'.
Check the following sample (where the search is case-sensitive)
suppose the file is loaded to a buffer pointed by pData.
char *pStart = "codeproject";
char *p = pStart;
int nFound = 0;
for (int i=0;i<file_length;i++)
{
if (*p == NULL)
{
nFound++;
p = pStart;
continue;
}
if (*p == pData[i])
p++;
else
p = pStart;
}
|
|
|
|
|
Hello,
I need to link my application to an OPC server (write and read data). I have no idea how to do this.
Is there anybody who has a simple example? Is it the same way as using ODBC or is it complete different thing? Do you know any good books or internet links?
Thank you in advance
|
|
|
|
|
Does anyone know how to programmatically disable/enable network adapter card on NT4?
I need to be able to enable or disable the network adapter card programmatically on NT4 for the project I am working on. I am running out of ideas...
thanks in advance.
David.
|
|
|
|
|
Perhaps you could explain what you mean by "disable/enable network adapter card."
|
|
|
|
|
hi, i hv a c function library which require me to pass a callback
function pointer into it. since that parameter cannot accept member
function, i try to solve it by passing static function pointer.
-------------------------------------------------------------------------------------------------
class CXFaceRecognitionDlg : public CDialog
{
// Construction
public:
CXFaceRecognitionDlg(CWnd* pParent = NULL); // standard constructor
static void callback(IplImage* image);
}
void CXFaceRecognitionDlg::callback(IplImage* image)
{
DetectAndDrawFaces( image ); // c function lib
//????but how to update CXFaceRecognitionDlg GUI????
}
-------------------------------------------------------------------------------------------------
but the problem goes on. i need to do some CXFaceRecognitionDlg GUI
update inside the static function. but since static callback function
can only access to static function and variable, there are no way for
me to access the member function and variable of CXFaceRecognitionDlg.
can anyone tell me how can i solve this problem?
thank you.
regards
yccheok
|
|
|
|