|
VCProgrammer wrote: can anybody plz help me this....
Read here.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
Inside your function, the debugger doesn't really know the size of your array, since it's really a pointer to the start of the array.
You could open a watch window and type
array,1024
and it will then display all 1024 values.
Hope that helps.
Karl - WK5M
PP-ASEL-IA (N43CS)
PGP Key: 0xDB02E193
PGP Key Fingerprint: 8F06 5A2E 2735 892B 821C 871A 0411 94EA DB02 E193
|
|
|
|
|
Hi guys,
I'm not sure is this the right place to ask, but I know that you are the right people
I want to draw an icon from an ico file on the screen (lets say main form).
Can you show me a fragment of code (C++ preferably, GDI+) that will load an icon file and display the second sub-icon from it (in the .ico I have one icon in three dimensions. I want to see the second dimension).
Thanks in advance!
|
|
|
|
|
|
Hi All
How can i compare two Date?I have starting date a="22/2/2009" and current date b="24/4/2009".How can i compare a and b is equal or not?Plz help me
|
|
|
|
|
MsmVc wrote: How can i camper two Date?
Camper ? You mean compare ? How are your dates stored ? If you have two strings, just compare the two strings. Have a look at the COleDateTime class[^] also.
|
|
|
|
|
Cedric Moonen wrote: If you have two strings, just compare the two strings
Provided they have the same format...
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
[My articles]
|
|
|
|
|
MsmVc wrote: I have starting date a="22/2/2009" and current date b="24/4/2009".How can i camper a and b is equal or not?
They looks not equal.
You may transform the strings into two COleDateTime objects (just using properly ParseDateTime method) and the use the COleDateTime 's == operator.
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
[My articles]
|
|
|
|
|
You could use something like difftime() . If you are using MFC, check out CTime or COLEDateTime . Short of that, you could convert each to a number in YYYYMMDD format and just compare like you would any other number.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
You can also fill in a SystemTime structure, and then call SystemTimeToFileTime, and then CompareFileTime.
Anyone who thinks he has a better idea of what's good for people than people do is a swine.
- P.J. O'Rourke
|
|
|
|
|
Hi there,
I have a DLL (DLL_1)for some measurement instrument that exports some functions, when I load DLL_1 from an MFC application and call Function_1 everything goes fine, but this not the way I want to use DLL_1. What I am trying to do is to create another DLL (DLL_2) to load the DLL_1 and call Function_1 but this always fails with a memory read error saying something like: "the memory at address 0x5435345 could not be read", this is wiered coz it is exactly the same code on the same machine.
btw: Function_1 has one integer parameter so I don't think it has anything to do with passing parameters to the function!
Could this have anything with the way DLLs manage memory? Any help? Any ideas?
Thanks alot
And ever has it been that love knows not its own depth until the hour of separation
Mohammad Gdeisat
|
|
|
|
|
Did you try to use your debugger to retrieve more information about the problem ?
|
|
|
|
|
Hi,
Unfortunately I have the DLL as release mode executable with no debugging information at all! the only thing the debugger will be able to display is some assembly code along with memory addresses which are not likely to be of much use, if you think that I can use them in someway plz let me know.
btw: the function call (that craches when is made from a DLL) is so simple that it goes like this:
int res = MyFunction(4);
Cheers
And ever has it been that love knows not its own depth until the hour of separation
Mohammad Gdeisat
|
|
|
|
|
Are you allocating/unallocating memory? If the answer is yes, see, for instance [^], <[^].
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
[My articles]
|
|
|
|
|
No, I am not allocating any memory in my own code, I only call one function like this:
int res = MyFunction(5);
that's all I do.
Thanks for the reply
And ever has it been that love knows not its own depth until the hour of separation
Mohammad Gdeisat
|
|
|
|
|
I Want to Create process on Remote computer.But, I Invoke GetObject() failed with message:"Access Denied" .thanks.
The code:
HRESULT hres;
hres = CoInitializeEx(0, COINIT_MULTITHREADED);
if (FAILED(hres))
{
TRACE("Failed to initialize COM library. Error code = %ld",hres);
return;
}
if(S_OK!= CoInitializeSecurity(NULL, -1, NULL, NULL, RPC_C_AUTHN_LEVEL_CONNECT, RPC_C_IMP_LEVEL_IDENTIFY, NULL, EOAC_NONE, 0) )
{
TRACE("Failed to initialize security. Error code = %ld\n",hres);
CoUninitialize();
return;
}
IWbemLocator *pLoc = NULL;
hres = CoCreateInstance(
CLSID_WbemLocator,
0,
CLSCTX_INPROC_SERVER,
IID_IWbemLocator, (LPVOID *) &pLoc);
if (FAILED(hres))
{
TRACE("Failed to create IWbemLocator object.Err code = %ld\n",hres);
CoUninitialize();
return;
}
IWbemServices *pSvc = NULL;
hres = pLoc->ConnectServer(
_bstr_t(L"\\\\192.168.0.2\\ROOT\\CIMV2"),
_bstr_t("administrator"),
_bstr_t("2007"),
NULL,
NULL,
NULL,
0,
&pSvc
);
if (FAILED(hres))
{
TRACE("Could not connect. Error code = %ld\n",hres);
pLoc->Release();
CoUninitialize();
return;
}
TRACE("Connected to ROOT\\CIMV2 WMI namespace\n");
hres = CoSetProxyBlanket(
pSvc,
RPC_C_AUTHN_WINNT,
RPC_C_AUTHZ_NONE,
NULL,
RPC_C_AUTHN_LEVEL_CALL,
RPC_C_IMP_LEVEL_IMPERSONATE,
NULL,
EOAC_NONE
);
if (FAILED(hres))
{
TRACE("Could not set proxy blanket. Error code = %ld\n",hres);
pSvc->Release();
pLoc->Release();
CoUninitialize();
return;
}
BSTR MethodName = SysAllocString(L"Create");
BSTR ClassName = SysAllocString(L"Win32_Process");
IWbemClassObject* pClass = NULL;
[color=#FF0000] hres = pSvc->GetObject(ClassName, 0, NULL, &pClass, NULL);[/color]
if (FAILED(hres))
{
TRACE("Could not GetObject. Error code = %ld\n",hres);
SysFreeString(ClassName);
SysFreeString(MethodName);
pSvc->Release();
pLoc->Release();
CoUninitialize();
return;
}
IWbemClassObject* pInParamsDefinition = NULL;
hres = pClass->GetMethod(MethodName, 0, &pInParamsDefinition, NULL);
IWbemClassObject* pClassInstance = NULL;
hres = pInParamsDefinition->SpawnInstance(0, &pClassInstance);
VARIANT varCommand;
varCommand.vt = VT_BSTR;
varCommand.bstrVal = L"\\\\192.168.2.2\\Setup\\IntraView.exe";
hres = pClassInstance->Put(L"CommandLine", 0,
&varCommand, 0);
if (FAILED(hres))
{
TRACE("Could not put. Error code = %ld\n",hres);
SysFreeString(ClassName);
SysFreeString(MethodName);
pClass->Release();
pSvc->Release();
pLoc->Release();
CoUninitialize();
return;
}
IWbemClassObject* pOutParams = NULL;
hres = pSvc->ExecMethod(ClassName, MethodName, 0,NULL, pClassInstance, &pOutParams, NULL);
if (FAILED(hres))
{
TRACE("Could not execute method. Error code = %ld\n",hres);
SysFreeString(ClassName);
SysFreeString(MethodName);
pClass->Release();
pInParamsDefinition->Release();
pOutParams->Release();
pSvc->Release();
pLoc->Release();
CoUninitialize();
return;
}
SysFreeString(ClassName);
SysFreeString(MethodName);
pClass->Release();
pInParamsDefinition->Release();
pOutParams->Release();
pLoc->Release();
pSvc->Release();
CoUninitialize();
|
|
|
|
|
It's been quite awhile since I coded this kind of thing, but, as I recall, the call to make once you have retrieved the IWbemServices pointer from IWbemLocator::ConnectServer is, IWbemServices::ExecQuery[^]. Are you getting WBEM_E_ACCESS_DENIED from GetObject? If so, you will probably get the same thing from IWbemServices::ExecQuery.
|
|
|
|
|
You are Right.I Try To Invoke ExecQuery ,but return the same message"Access Denied".
Are you once Remote Invoke the wmi
|
|
|
|
|
Hello All
I am tring to getpath of shortcut.I can do it for normal shortcut but in case of internet Explorer shortcut I am unable to find out path and icon.
i am using IShellLink .GetPath(...);
plz help me for internet explorer.
|
|
|
|
|
You can see the installed browsers on a 32 bit machine under following path
HKEY_LOCAL_MACHINE\SOFTWARE\Clients\StartMenuInternet\
you can fine fine the the path of internet explorer at following key
HKEY_LOCAL_MACHINE\SOFTWARE\Clients\StartMenuInternet\IEXPLORE.EXE\shell\open\command
the Icon will be embedded in the exe itself.
the index of the icon is available at
HKEY_LOCAL_MACHINE\SOFTWARE\Clients\StartMenuInternet\IEXPLORE.EXE\DefaultIcon
You can ExtractIcon or similar APIs to get the icon from executable.
-Sarath.
"Great hopes make everything great possible" - Benjamin Franklin
|
|
|
|
|
Thanks Sarath.
But i want programatically bye IShell.GetPath( is this not possilbe..?
|
|
|
|
|
in my project there is a function called ExportandZip().it is working normally in debug mode.but in relese mode it is giving an error saying that "there is no source line for debugging information"what might be the reason.please let me know?
kir_MFC
|
|
|
|
|
|
See Debugging Release Mode Problems[^].
Of one Essence is the human race
thus has Creation put the base
One Limb impacted is sufficient
For all Others to feel the Mace
(Saadi )
|
|
|
|
|
Sounds like the .pdb file is out of synch. Are you really wanting to debug in release mode? Can you delete the .pdb file and rebuild your project?
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|