|
Or insert a PictureControl and change the "Type" property of PictureControl to "Icon", then assign an ICON resource to "Image" property of PictureControl.
|
|
|
|
|
Use the ICON [^] resource control.
|
|
|
|
|
I read the characters from local file compressed by gzip, and want to uncompress the characters into another bytes buffer, not into local file.
How can I get it.
|
|
|
|
|
Perhaps with the zLib library?.
It is what gzip used in the first place, after all. With the added advantage of not needing to load the file first, and the additional bonus of being able to seek/read from a compressed file as though it were a standard non-compressed file. zLib gzip file access functions[^]
|
|
|
|
|
Using managed GZipStream[^] class. For unmanaged apps check CGzip[^] class found in codeproject.
|
|
|
|
|
Back to my MimeMap Question, but with more focus on the issue
If I get the value of the key that doesn't exist, comm return an empty array in the format I need, (I think so) which is empty. Maybe I can create a new safearray in the exact format, or just add my values to the existing array.
What do you think?
mimeMap | safearray of VARIANT = [0]()
VARIANT mimeMap;
VariantInit(&mimeMap);
hr = pADs->GetEx(CComBSTR("MimeMap"), &mimeMap);
|
|
|
|
|
I could find your MimeMap question. But even so, I can't make heads or tails of what you're saying...
What are you on about????
If your actions inspire others to dream more, learn more, do more and become more, you are a leader." - John Quincy Adams You must accept one of two basic premises: Either we are alone in the universe, or we are not alone in the universe. And either way, the implications are staggering” - Wernher von Braun
|
|
|
|
|
I was brain dead when I posted the question, I read again and it didn't make sense to me either.
I'm frustrated with the mimemap and ADS. I get the error -2147463156. I decoded the error to my input data not being in the correct format of a safe array.When I examine &var in PutEx, it looks like a safe array to me, but putEx just rejects it. I've googled the subject, but it looks so complex, in which articles talk about a pointer in the package, that points to a record in the safe array, BSTR's, VT's. I found 1 vb example of a successful add to MimeMap, if I could just package my data correctly, I could add the data to the key. Just looking for help again.
LPWSTR pszMimes[] =
{
L".application, application/x-ms-application",
L".deploy, application/octet-stream",
L".flv, video/x-flv",
L".manifest, application/-x-ms-manifest",
L".msp, application/octet-stream",
L".msu, application/octet-stream",
};
DWORD dwNumber = sizeof(pszMimes)/sizeof(LPWSTR);
hr = ADsBuildVarArrayStr(pszMimes, dwNumber, &var);
if ( SUCCEEDED (hr )) {
hr = pADs->PutEx(ADS_PROPERTY_UPDATE, CComBSTR("MimeMap"), CComVariant(var) );
VariantClear(&var);
if ( SUCCEEDED (hr )) {
hr = pADs->SetInfo();
}
}
|
|
|
|
|
Well -2147463156 == 0x8000500C == E_ADS_CANT_CONVERT_DATATYPE (Generic ADSI Error Codes[^])
So there's something in the var that can't be converted.
Have you tried calling VariantInit(&var) before calling ADsBuildVarArrayStr[^]?
IADs::PutEx[^]
If your actions inspire others to dream more, learn more, do more and become more, you are a leader." - John Quincy Adams You must accept one of two basic premises: Either we are alone in the universe, or we are not alone in the universe. And either way, the implications are staggering” - Wernher von Braun
|
|
|
|
|
Yes Sir.
I'm convinced that I have a safe array. it works on many other keys just fine. It's just the MimeMap Key, I really need to figure out how to decode the HRESULT numbers.
-2147463160, -2147463156
I give up. Going to put this on my ELance list and farm it out next week.
Thanks for the help, I got most of it written myself.
|
|
|
|
|
I am at a loss and I am hoping someone can lead me down the right path. I have a COM dll that is written in C++. If a user is on Windows7 (or higher), the user will have the option of invoking this new functionality. Otherwise, it will not be available. The problem is that this new functionality uses specific libraries that are only available with Windows7. I didn't think it was a problem until I went to register the DLL on a XP box, where the registration fails. I am certain it is because of these libraries (which are in the project settings). Is there any way to make the DLLS conditional? I have been looking for some different methods but I haven't located anything.
|
|
|
|
|
You can try using the "delay load" functionality of the linker for the dependent Win7 DLLs.
If that doesn't work, you will need to LoadLibrary()[^] them, and use GetProcAddress()[^]
If your actions inspire others to dream more, learn more, do more and become more, you are a leader." - John Quincy Adams You must accept one of two basic premises: Either we are alone in the universe, or we are not alone in the universe. And either way, the implications are staggering” - Wernher von Braun
|
|
|
|
|
Ah, loadlibrary, it never even occurred to me. I have used it for DLLs but I have never tried it for libraries. I will give that a try.
|
|
|
|
|
If these are static libraries (.LIBs) you're linking to that refer to win7 dlls, then you'll need to put the code that refers to those static libraries into a DLL and then LoadLibrary() those.
Also you could detect the OS, and only LoadLibrary() when on Win7 or greater.
If your actions inspire others to dream more, learn more, do more and become more, you are a leader." - John Quincy Adams You must accept one of two basic premises: Either we are alone in the universe, or we are not alone in the universe. And either way, the implications are staggering” - Wernher von Braun
|
|
|
|
|
Hi,
When you compile your COM library you need to #define the appropriate WINVER, _WIN32_WINNT and _WIN32_IE. By setting these values the windows headers will #include or exclude specific functions/libraries. You may receive some compilation errors after setting these values. Do not panic... you will need to use LoadLibrary/GetProcAddress at runtime to determine if the functions are available. Some Win7 features may not be available on WinXP so you may need to re-implement some portions of your application for backwards compatibility.
Using the Windows Headers[^]
Best Wishes,
-David Delaune
|
|
|
|
|
I'm using ShellExecuteEX just to get started with my project, and I'm sure there will be offers of a better way to complete the task. My post yesterday was to build the parameter string for ShellExecuteEX, in which I run the Pkgmgr.exe program
There are 2 ways to run the program
1. pkgmgr.exe /iu:myparameters - starts program, but quickly releases shell once program starts.
2. Start /w pkgmgr.exe /iu:myparamters - starts program, does not release shell until it's complete.
I want the second method, so my program waits until the shell completes, but ShellExecuteEx actually checks for the existence of the program file as a pre-flight check.
I was also wondering if there is a way to attach a window of something to so progress.
lp_Operation = "open";
lp_File = "pkgmgr.exe";
lp_Directory = msi_DIR_AppVolumeFolder_II;
lp_Parameters = caWin._create_IIS_Pkgmgr_Install_Parameters();
SHELLEXECUTEINFO lpExecInfo;
lpExecInfo.cbSize = sizeof(SHELLEXECUTEINFO);
lpExecInfo.lpFile = lp_File;
lpExecInfo.fMask = SEE_MASK_DOENVSUBST|SEE_MASK_NOCLOSEPROCESS ;
lpExecInfo.hwnd = NULL;
lpExecInfo.lpVerb = lp_Operation;
lpExecInfo.lpParameters = lp_Parameters;
lpExecInfo.lpDirectory = lp_Directory;
lpExecInfo.nShow = SW_SHOW ;
lpExecInfo.hInstApp = (HINSTANCE) SE_ERR_DDEFAIL ;
exit_Code = ShellExecuteEx(&lpExecInfo);
if(lpExecInfo.hProcess !=NULL) {
::WaitForSingleObject(lpExecInfo.hProcess, INFINITE);
::CloseHandle(lpExecInfo.hProcess);
}
|
|
|
|
|
To get a "progress window", you could run the pkgmgr.exe from the command line:
CMD [/A | /U] [/Q] [/D] [/E:ON | /E:OFF] [/F:ON | /F:OFF] [/V:ON | /V:OFF]
[[/S] [/C | /K] string]
/C Carries out the command specified by string and then terminates
/K Carries out the command specified by string but remains
/S Modifies the treatment of string after /C or /K (see below)
/Q Turns echo off
/D Disable execution of AutoRun commands from registry (see below)
/A Causes the output of internal commands to a pipe or file to be ANSI
/U Causes the output of internal commands to a pipe or file to be
Unicode
/T:fg Sets the foreground/background colors (see COLOR /? for more info)
/E:ON Enable command extensions (see below)
/E:OFF Disable command extensions (see below)
/F:ON Enable file and directory name completion characters (see below)
/F:OFF Disable file and directory name completion characters (see below)
/V:ON Enable delayed environment variable expansion using ! as the
delimiter. For example, /V:ON would allow !var! to expand the
variable var at execution time. The var syntax expands variables
at input time, which is quite a different thing when inside of a FOR
loop.
/V:OFF Disable delayed environment expansion.
So, do the following:
lp_File = "cmd.exe"
lp_Parameters = CString("/k pkgmgr.exe ") + lp_Parameters;
This will start a command prompt and then run the pkgmgr.exe program.
To get the full help on cmd, start a command prompt (this *is* cmd.exe) and type cmd /?
If your actions inspire others to dream more, learn more, do more and become more, you are a leader." - John Quincy Adams You must accept one of two basic premises: Either we are alone in the universe, or we are not alone in the universe. And either way, the implications are staggering” - Wernher von Braun
|
|
|
|
|
Good idea, didn't think of that.
What about the Start /w pkgmgr.exe to satisfy the pkgmgr?
or /k Start /w pkgmgr.exe /iu:
Let me try them all out first and see what happens
Thanks, be back in an hour
|
|
|
|
|
I didn't like the cmd window hanging there with a blinking cursor, Although it did the job.
I added the CoIntialize to the Shell Execute, and it grabs the process, and doesn't let go until the pkgmgr.exe completes now. Before it just came back after the program started running. Now I just need to add the exitCode stuff in case it fails for some reason, and check the errorlevel code at the end.
I'm going to leave it at this for now.
SHELLEXECUTEINFO lpExecInfo = {0};
lpExecInfo.cbSize = sizeof(SHELLEXECUTEINFO);
lpExecInfo.lpFile = lp_File;
lpExecInfo.fMask = SEE_MASK_DOENVSUBST|SEE_MASK_NOCLOSEPROCESS ;
lpExecInfo.hwnd = NULL;
lpExecInfo.lpVerb = lp_Operation;
lpExecInfo.lpParameters = lp_Parameters;
lpExecInfo.lpDirectory = lp_Directory;
lpExecInfo.nShow = SW_SHOW ;
lpExecInfo.hInstApp = (HINSTANCE) SE_ERR_DDEFAIL ;
hr = CoInitializeEx(NULL, COINIT_APARTMENTTHREADED | COINIT_DISABLE_OLE1DDE);
if ( FAILED( hr ) ) {
CoUninitialize();
hr = CoInitializeEx( NULL, COINIT_MULTITHREADED );
if ( FAILED( hr ) ) {
wprintf( L"CoInitialize failed. Error 0x%0x\n", hr );
goto comError;
}
}
exit_Code = ShellExecuteEx(&lpExecInfo);
if(lpExecInfo.hProcess !=NULL) {
::WaitForSingleObject(lpExecInfo.hProcess, INFINITE);
::CloseHandle(lpExecInfo.hProcess);
}
comError:
CoUninitialize();
|
|
|
|
|
you can use cmd /c instead of cmd /k and then the command window will disappear once pkgmgr.exe completes.
If your actions inspire others to dream more, learn more, do more and become more, you are a leader." - John Quincy Adams You must accept one of two basic premises: Either we are alone in the universe, or we are not alone in the universe. And either way, the implications are staggering” - Wernher von Braun
|
|
|
|
|
I have a C program and here I invoke the Weka software how can I do? I thank you all for your help!
|
|
|
|
|
|
what I want to do and a C program to invoke the software Weka. I can do this if you like? eg with the previous answer but I would like to understand how to go about my problem! thanks to all
|
|
|
|
|
Did you bother to follow the links provided by Madhu? They clearly demonstrate how to solve your problem.
"One man's wage rise is another man's price increase." - Harold Wilson
"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
"Some people are making such thorough preparation for rainy days that they aren't enjoying today's sunshine." - William Feather
|
|
|
|
|
I'm still amazed by some of the laziness shown by some site users...
|
|
|
|
|