|
Declare the classes as __declspec(dllexport) for the DLL, and __declspec(dllimport) for the EXE.
Don't try it, just do it!
|
|
|
|
|
Hi Alexander. Thank u very much for your reply. I'm not expert in VC++; I don't know how to make use of your reply. I have never dealt with dlls before! I just want to view the dialog specified in the dialog class in dll file. I think that the dll should contain the dialog class only then another function should call Domodal method of the dialog object. I think this function must be in the dll file also. Then I'll link this dll to exe file that call the function in dll and this function will view the dialog, and then return a value to exe file according to what the user entered in the dialog.
Plz tell me how to make it and how to view the dialog from dll!!
Thank u very much
Muh Ulama
|
|
|
|
|
how can write multiple line text on a bitmap with TextOut()
Can do it by DrawText()?
|
|
|
|
|
Yes, you can.
Don't try it, just do it!
|
|
|
|
|
See here for an example.
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
Does anyone kknow why MS dropped the class wizard we used to have in VC++ 6.0 ?
I know that if you right-click a control on a dialog you can add a message handler but what if you want to add a function such as OnInitDialog() to a dialog. I can't find an easy way to do it, do MS expect us to manually add functions like this or am I missing a wizard ?
Any ideas ?
Users.
Can't live with 'em, can't kill em!
|
|
|
|
|
View -> Properties Window -> click the Overrides button
Painted on the side of a dog trainer's van: SIT HAPPENS
|
|
|
|
|
Hello All,
I need to add a function to a MFC-MDI Application to size automatically the subframe's size.
Exactly something like tile-horizontally/vertically, but with the difference that I want to choose every window position and height/width, (IMPORTANT) using a fraction of the available space.
To do this at the moment I set the frame size with 'MoveWindow', and I get the available client area with 'AfxGetMainWnd->GetWindowPlacement'; but this function doesn't cut from the available client area the statusbar/toolbars.
Is there a way to know the REAL available client area without manually search the space occuped from the statusbar or toolbar (that are not constant)?
To be more clear: my temporary solution is to Minimize all -1 windows, and call MDITile(MDITILE_VERTICAL), at this point this window's size is exacly the CRect (with GetWindowPlacement) that I'm searcing, so I can do by myself the others windows sizing. I don't like this solution because this cause too many windows moviments (and it is quite slow).
:-DThanks to everybody wants to help me!
|
|
|
|
|
(1) Is the a COM Library function to find the InProc Server of a given CLSID?
or do I have to query the registry?
(2) Can I increment the "DLL Reference count" having a HMODULE?
(I guess I could GetModuleFileName, and issue another LoadLibrary, but maybe there is a shorter way)
Pandoras Gift #44: Hope. The one that keeps you on suffering. aber.. "Wie gesagt, der Scheiss is' Therapie" boost your code || Fold With Us! || sighist | doxygen
|
|
|
|
|
(2) No, because the COM server DLL manages this reference count and if it does not export a function to change it you won't be able to set it. Incrementing can be done by creating class instances of that COM server.
Don't try it, just do it!
|
|
|
|
|
I search to add, in the left icon bar of the XP Filedialog, some shortcut (Favorite, or other directory)
Can you help me?
|
|
|
|
|
if i understood u correctly, u want to add a icon to a folder.
But what folder, where, how ,why??
Plz be more accurate so we can help u
/\|-||\/|/\|)
|
|
|
|
|
In the CFileDialog in XP , when you use the CFile with the last param dwsize = 0 (VC7):
CFileDialog dlgFile(
TRUE,
_T(".Xls"),
NULL,
OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT,
_T("Excel (*.xls)|*.Xls|All (*.*)|*.*||"),this,0);
You have in the left bar some icon shortcut : (i think in english is same of that )
My recent document;
Desk;
My document ;
My Computer;
My Network P...;
I want add New icon like that :
Favorite ("C:\documents and settings\MyName\favorites")
Project ("H:\Drawing Project")
or other ....
to access quickly to this directory
|
|
|
|
|
The area you wish to add to is called the Places Bar. You'll first need to modify the HKEY_CURRENT_USER\Software\Microsoft\Office\9.0\Common\Open Find\Places\UserDefinedPlaces registry key. See MSDN article Q205041 for an example.
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
Thank you
It's good for MSOffice Open save dialog box... But when I add the CFileDialog in C++ I have not the tools combo, and the cfiledialog don't add my userdefinedplaces ...
|
|
|
|
|
Thierry Lebrun wrote:
...the cfiledialog don't add my userdefinedplaces ...
That's because you are using CFileDialog instead of GetOpenFileName() . The former uses OFN_ENABLEHOOK while the latter does not.
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
|
Thank,
I come back from holidays ,
I have add the place in registry and it work fine for MSWord
but not in my program
I have add this (msdn)sample, the dialog file is XP look but the place Bar is the standard
OPENFILENAME ofn; // common dialog box structure
char szFile[260]; // buffer for file name
HWND hwnd; // owner window
HANDLE hf; // file handle
hwnd = GetSafeHwnd();
// Initialize OPENFILENAME
ZeroMemory(&ofn, sizeof(ofn));
ofn.lStructSize = sizeof(ofn);
ofn.hwndOwner = hwnd;
ofn.lpstrFile = szFile;
//
//
ofn.lpstrFile[0] = '\0';
ofn.nMaxFile = sizeof(szFile);
ofn.lpstrFilter = "All\0*.*\0Text\0*.TXT\0";
ofn.nFilterIndex = 1;
ofn.lpstrFileTitle = NULL;
ofn.nMaxFileTitle = 0;
ofn.lpstrInitialDir = NULL;
ofn.Flags = OFN_PATHMUSTEXIST | OFN_FILEMUSTEXIST;
// Display the Open dialog box.
if (GetOpenFileName(&ofn)==TRUE)
hf = CreateFile(ofn.lpstrFile, GENERIC_READ,
0, (LPSECURITY_ATTRIBUTES) NULL,
OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL,
(HANDLE) NULL);
|
|
|
|
|
I have found the solution !!!!!
OPENFILENAME l_ofn; // common dialog box structure
char l_szFile[260]; // buffer for file name
HWND l_hwnd; // owner window
HANDLE l_hf; // file handle
char l_szBuf[80];
DWORD l_dwData;
HKEY l_hkMyCU;
HKEY l_hkPlaceBar;
CString l_Key_PlacesBar = "Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\ComDlg32\\PlacesBar";
RegCreateKey(HKEY_CURRENT_USER, "CALLuna", &l_hkMyCU);
RegOverridePredefKey(HKEY_CURRENT_USER, l_hkMyCU);
if (RegCreateKey(HKEY_CURRENT_USER, l_Key_PlacesBar, &l_hkPlaceBar) != ERROR_SUCCESS)
{
AfxMessageBox ("Could not create the registry key.");
}
/*
predefined decimal values
=========================
Windows Defined Folder Decimal Code
All Users Desktop 25
All Users Documents 46
All Users Programs 23
All Users Start Menu 22
All Users StartUp Folder 24
Common Files 43
Control Panel 3
Cookies 33
Current Users Programs 2
Current Users Start Menu 11
Current User StartUp Folder 7
Desktop 0
Documents and Settings 40
Favorites 6
Fonts 20
History 34
My Computer 17
My Documents 5
My Music 13
My Pictures 39
My Video 14
Network Neighborhood 18
Program Files 38
Recent Documents 8
Recycle Bin 10
System32 37
Temporary Internet Files 32
Windows 36
*/
// Disque C:
strcpy(l_szBuf, "c:\\");
if (RegSetValueEx(l_hkPlaceBar,
"Place0",
0,
REG_EXPAND_SZ,
(LPBYTE) l_szBuf,
strlen(l_szBuf) + 1)) AfxMessageBox("Could not set the event message file.");
// My Computer
l_dwData = 17;
if (RegSetValueEx(l_hkPlaceBar,
"Place1",
0,
REG_DWORD,
(LPBYTE) &l_dwData,
sizeof(DWORD))) AfxMessageBox("Could not set the supported types.");
// My Document
l_dwData = 5;
if (RegSetValueEx(l_hkPlaceBar, // subkey handle
"Place2", // value name
0, // must be zero
REG_DWORD, // value type
(LPBYTE) &l_dwData, // pointer to value data
sizeof(DWORD))) // length of value data
AfxMessageBox("Could not set the supported types.");
strcpy(l_szBuf, "d:\\Perso");
if (RegSetValueEx(l_hkPlaceBar, // subkey handle
"Place3", // value name
0, // must be zero
REG_EXPAND_SZ, // value type
(LPBYTE) l_szBuf, // pointer to value data
strlen(l_szBuf) + 1)) // length of value data
AfxMessageBox("Could not set the event message file.");
// Favorites
l_dwData = 6;
if (RegSetValueEx(l_hkPlaceBar, // subkey handle
"Place4", // value name
0, // must be zero
REG_DWORD, // value type
(LPBYTE) &l_dwData, // pointer to value data
sizeof(DWORD))) // length of value data
AfxMessageBox("Could not set the supported types.");
RegCloseKey(l_hkPlaceBar);
l_hwnd = GetSafeHwnd();
// Initialize OPENFILENAME
ZeroMemory(&l_ofn, sizeof(l_ofn));
l_ofn.lStructSize = sizeof(l_ofn);
l_ofn.hwndOwner = l_hwnd;
l_ofn.lpstrFile = l_szFile;
//
// Set lpstrFile[0] to '\0' so that GetOpenFileName does not
// use the contents of l_szFile to initialize itself.
//
l_ofn.lpstrFile[0] = '\0';
l_ofn.nMaxFile = sizeof(l_szFile);
l_ofn.lpstrFilter = "All\0*.*\0Text\0*.TXT\0";
l_ofn.nFilterIndex = 1;
l_ofn.lpstrFileTitle = NULL;
l_ofn.nMaxFileTitle = 0;
l_ofn.lpstrInitialDir = NULL;
l_ofn.Flags = OFN_PATHMUSTEXIST | OFN_FILEMUSTEXIST ;
// Display the Open dialog box.
if (GetOpenFileName(&l_ofn)==TRUE)
l_hf = CreateFile(l_ofn.lpstrFile, GENERIC_READ,
0, (LPSECURITY_ATTRIBUTES) NULL,
OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL,
(HANDLE) NULL);
RegOverridePredefKey(HKEY_CURRENT_USER, NULL);
RegCloseKey(l_hkMyCU);
|
|
|
|
|
I have a problem with timer,
I set a timer to enable each 1 mili second .
and i have written a handler when WM_TIMER occured.
For example in my timer handler have this function:
i++;
after 1 minute(eaual to 60000 ms) the value of i should be 60000.
But it;s value near to 4000.
I think windows timer could not send WM_TIMER every 1 ms.
Also I test some of OS definition such as CRITICAL SECTION for handler .
Do you have any suggestion to solve this problem.
|
|
|
|
|
Windows 9i, 2000, XP is not a Hard Real Time OS and it's impossible to reach 1 ms timer resolution. You can make threads and set its priority to have a better result than 4000 ticks i a minut but you'll never reach 1 ms without adding a patch (Venturcom RTX) or changing to Windows CE that I think it reaches it.
Marc Soleda.
... she said you are the perfect stranger she said baby let's keep it like this... Tunnel of Love, Dire Straits.
|
|
|
|
|
|
I'm including #import <mshtml.tlb> in my VC 6.0/SP5 project. When I remove this line, compilation fails, but building of the "browse info" (bscmake) will complete sucessfully.
But when I include this line in the source, bscmake will crash with unhandled exception.
How to solve this ? I've tried this command line switch for bscmake: /Ei (mshtml.tli mshtml.tlh)
It worked when I've executed bscmake from command line, but it's not working when I include it in the GUI's project settings.
Is there some preprocessor directive or variable defined when bscmake is parsing the sources ? I'd try to force bscmake to skip #import line in some way.
Thank you!
rrrado
|
|
|
|
|
nevermind i've found solution
rrrado
|
|
|
|
|
HI all..
i want to know of any function to disable/remove the close Button on a dialog(CROSS button on top right corner).
It can be done by setting the property of the dialog but that is not what i want.
Thanks
|
|
|
|
|