|
Hello,
I have a application UI developed using MFC, however the contents of the controls i.e. strings that needs to be displyed on the various controls(static texts, buttons, lilst boxes etc.) on the dialog boxes are determined at run time. So I need a Intelligent control resizing and positioning utility so that asthetics of the dialog box is maintained when one or the other control is stretched from its statically designed area.
This utility is also required for other purpose : I wish to internationalize my application and I do not want to maintain seperate resource DLL for each language supported by my application.
Any pointers or clues in this direction will be helpfull.
Thanks
Suyash
|
|
|
|
|
|
Hi Sarath,
Thanks, its of great help, in particular http://www.codeproject.com/useritems/SizingDialog.asp,
Though it doesn't solve my problem completely, i can re-use it.
However I still feel there should be some utility developed particularly for my problem, as its very generic requirement for multilingual application if we do not wish to maintain seperate resource dlls.
Anyways, Thanks much.
Regards
Suyash
|
|
|
|
|
Hi
I have one opensource of vc++. While executing this code it is giving the following errors.
1)error C2433: 'HWND' : 'inline' not permitted on data declarations
2)error C2143: syntax error : missing ';' before '{'
3)error C2447: '{' : missing function header (old-style formal list?)
4)error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
5)error C2086: 'int CALLBACK' : redefinition
If any one got these errors and knew the solution please let me know.
Thank You
angle
ThankU
angel
|
|
|
|
|
Can you provide more details of the code or code snap ?
How can we guess where the errors occures and why?
Knock out 't' from can't,
You can if you think you can
|
|
|
|
|
|
Can you be more specific its a little.
whitesky
|
|
|
|
|
I want to know how to find the HDD Serial Number from using C++ or C or any assembly code.
Thanks,
Anwar.
|
|
|
|
|
|
anwar1026 wrote: I want to know how to find the HDD Serial Number from using C++ or C or any assembly code.
Check GetVolumeInformation() API where you get the information of the volume serial number in lpVolumeSerialNumber parameter.
Here you get more information[^]
Knock out 't' from can't,
You can if you think you can
-- modified at 8:01 Friday 9th June, 2006
|
|
|
|
|
If you need volume's serial number (for logical disks C:, D:, etc.), you can use GetVolumeInformation function.
If you need serial numbers of your hard disks as physical devices, you can follow the famous Windows Management Instrumentation (WMI) way, which does not look so simple:
#define _WIN32_WINNT 0x0400
#include <objbase.h>
#include <comdef.h>
#include <Wbemidl.h>
# pragma comment(lib, "wbemuuid.lib")
_COM_SMARTPTR_TYPEDEF(IWbemLocator, __uuidof(IWbemLocator));
_COM_SMARTPTR_TYPEDEF(IWbemServices, __uuidof(IWbemServices));
_COM_SMARTPTR_TYPEDEF(IEnumWbemClassObject, __uuidof(IEnumWbemClassObject));
_COM_SMARTPTR_TYPEDEF(IWbemClassObject, __uuidof(IWbemClassObject));
int main()
{
CoInitializeEx(NULL, COINIT_MULTITHREADED);
CoInitializeSecurity(
NULL,
-1,
NULL,
NULL,
RPC_C_AUTHN_LEVEL_DEFAULT,
RPC_C_IMP_LEVEL_IMPERSONATE,
NULL,
EOAC_NONE,
NULL);
IWbemLocatorPtr locator;
CoCreateInstance(
CLSID_WbemLocator,
0,
CLSCTX_INPROC_SERVER,
IID_IWbemLocator,
(LPVOID *)&locator
);
IWbemServicesPtr services;
locator->ConnectServer(
_bstr_t(L"ROOT\\CIMV2"),
NULL,
NULL,
0,
NULL,
0,
0,
&services
);
IEnumWbemClassObjectPtr enumerator;
services->ExecQuery(
bstr_t("WQL"),
bstr_t("SELECT * FROM Win32_DiskDrive"),
WBEM_FLAG_FORWARD_ONLY | WBEM_FLAG_RETURN_IMMEDIATELY,
NULL,
&enumerator);
IWbemClassObjectPtr object = 000;
for( ; ; )
{
ULONG ret;
enumerator->Next(WBEM_INFINITE, 1, &object, &ret);
if( ret == 0) break;
_variant_t variant;
object->Get(L"Caption", 0, &variant, 0, 0);
MessageBox(0, _bstr_t(variant), "The serial number is:", MB_OK);
}
return 0;
}
Hope it helps.
|
|
|
|
|
I cannot find this file
Wbemidl.h
Anwar.
|
|
|
|
|
The "WbemIdl.h" file is located in "Vc*\PlatformSDK\Include\WbemIdl.h" subdirectory of Visual Studio 2003 or 2005. Are you using another compiler? Or may be you have a reduced variant of Visual Studio.
WMI includes more header files, libraries and DLLs. In Windows 98, WMI has to be installed separately.
I think you would have to download WMI from Microsoft site.
|
|
|
|
|
Well... I am using Visual Studio 6.0
And it would not be possible for me to move to Visual Studio .NET 2003 or higher.
Anwar.
|
|
|
|
|
It's part of the Platform SDK.
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
|
|
|
I think you have trouble in your brain?
Sorry....this is wrong forum.
Knock out 't' from can't,
You can if you think you can
|
|
|
|
|
Encrypted query*
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
just for fun!!!
sorry for disturbing u all !!!!
JAYARAJ
|
|
|
|
|
_beginthread(CopyProcessTh, 0, NULL);//error C3867: 'CDlg::CopyProcessTh': function call missing argument list; use '&CDlg::CopyProcessTh' to create a pointer to member
void CDlg::CopyProcessTh(void * p)
{
dlg=new CCopyInterface(this);
if (m_copiedFile.GetLength()!=0)
{
dlg->CopyFileFunct(m_copiedFile,m_leftFolder);
}
}
|
|
|
|
|
NoName II wrote:
_beginthread(CopyProcessTh, 0, NULL);//error C3867: 'CDlg::CopyProcessTh': function call missing argument list; use '&CDlg::CopyProcessTh' to create a pointer to member
1) Made the CopyProcessTh as a static in the class which returns UINT from the function which is recommended to terminate the thread.
OR
2) Seperate out the function from the class with following prototype
UINT CopyProcessTh(LPVOID pparam)
{
return 0;
}
Knock out 't' from can't,
You can if you think you can
|
|
|
|
|
I can't made CopyProcessTh as a static cause it should operate with nonstatic members..
as for the 2nd...error C3867: 'CDlg::CopyProcessTh': function call missing argument list; use '&CDlg::CopyProcessTh' to create a pointer to member
|
|
|
|
|
NoName II wrote: I can't made CopyProcessTh as a static cause it should operate with nonstatic members..
You can't pass a non-static member function to _beginthread. The reason is that static and non-static member functions don't have the same prototype. Non-static member functions have an implicit parameter that is passed: the 'this' parameter. Look at the post of WhyteSky for the 'workaround' to this problem.
Cédric Moonen
Software developer
Charting control
|
|
|
|