|
ShellExecute or ShellExecuteEx will automagically map the extension to the proper registered program
|
|
|
|
|
Thank you very much for taking the time to help me solve my problem. I really appreciate it!
-Ian
|
|
|
|
|
What you want is either FindExecutable() or AssocQueryString() .
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|
|
Thank you very much for taking the time to help me solve my problem. FindExecutable looks like it will work for my purposes. Thanks much!
-Ian
|
|
|
|
|
Ian Bowler wrote: I'm hoping i can pass ".txt" to a function, and get the default application associated with the ".txt" extension.
In Continuation with Mr. Crow.. Here is Code demonstrating use of AssocQueryString :-
Using AssocQueryString to find Executable associated with the Ext.[^]
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
Thank you very much for taking the time to help me solve my problem. I really appreciate it! I'll take a look at that example.
Thanks!
-Ian
|
|
|
|
|
I need some advice, as I am obviously missing something.
I am trying to add a desk band to my project, and all seems to be going well as far as the coding part is concerned. But how do you guys handle multiple builds and testing? You know the routine, you write some code, compile and build the dll, register it and try it out, unregister the dll, repeat. But I am having problems with the repeat part. The dll stays in use by windows, so it can not be deleted and rewritten when I do a rebuild. The only way I seem to be able to do this is by rebooting the computer.
Is there some trick that I can use to force windows to unload my dll?
I am using VC6 on W2K if that makes a difference.
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" - mYkel - 21 Jun '04
"There's not enough blatant self-congratulatory backslapping in the world today..." - HumblePie - 21 Jun '05
Within you lies the power for good - Use it!
|
|
|
|
|
unregister the dll
start a command shell
taskkill /f /im "explorer.exe"
start explorer.exe
|
|
|
|
|
'taskkill' is not recognized...
But thanks anyway, I am able to kill explorer via task manager, and restart it via the command shell. All works great now
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" - mYkel - 21 Jun '04
"There's not enough blatant self-congratulatory backslapping in the world today..." - HumblePie - 21 Jun '05
Within you lies the power for good - Use it!
|
|
|
|
|
ah taskkill is a XP command.
|
|
|
|
|
Have u tried Process Explorer by SysInternals[^]. This will give u the exact module which is using your dll. Then you can kill that module using TaskManager.
|
|
|
|
|
Hello guys,
I have encountered next situation and it would be nice if someone could clarify this :
class Foo
{
public :
int number1;
}Object;
int main()
{
cout<<&Object<<endl;
cout<<&(Object.number1)<<endl;
}
Does this have any eplanation
Why is the address of a class object same as its member variables address;
"Success is the ability to go from one failure to another with no loss of enthusiasm." - W.Churchill
|
|
|
|
|
|
Because number1 is the first member variable.
If you declare a second integer number2 below number1 in the class, its address will be 004575E4.
Best regards
Dominik
_outp(0x64, 0xAD);
and
__asm mov al, 0xAD __asm out 0x64, al
do the same... but what do they do??
(doesn't work on NT)
|
|
|
|
|
Giorgi Moniava wrote: Why is the address of a class object same as its member variables address
Why does that confuse you? Where else do you expect the members of a class to be stored?
This is correct behavior. It is simply telling you that the first member of Foo occupies the first memory location in Foo. If you add a member after the first and take it's address, then you will see it is N1 bytes after the first member's address, where N1 is the size of the first member.
|
|
|
|
|
He's obviously new at this. Give him a break.
------- sig starts
"I've heard some drivers saying, 'We're going too fast here...'. If you're not here to race, go the hell home - don't come here and grumble about going too fast. Why don't you tie a kerosene rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
I am. I asked a direct question so I can help him better.
|
|
|
|
|
( edited ... to change the subject line which was wrong ... )
(it's been one of those week ... and we're only tuesday ... )
now, I'm confused, is there a better C API than atof , scanf or strtod ? if my input string is not a well formed number ( either plain float number like 2.345 or scientific notation like "1.3e3" ) most of those will work.
double d = atof( "2 3" );
ASSERT( d == 2 );
float f = 0.0;
int iError = sscanf( "2f3", "%f", &f );
ASSERT( iError != EOF );
ASSERT( f == 2 );
char *stopstring;
float f1 = (float)strtod( "2v3", &stopstring );
ASSERT( f1 == 2 );
Is there a all inclusive API that will validate the input ? and give an error when a string that is NOT a valid number is entered.
I know I can do a heck of a lot of pre-validation beforehand on the input string, but it seems that is should be done by an existing API ...
Thanks.
Maximilien Lincourt
Your Head A Splode - Strong Bad
-- modified at 13:49 Tuesday 13th December, 2005
|
|
|
|
|
I don't think so, if you're limited to C only, then you're stuck doing this yourself, or finding some third party library or OS API to do so.
¡El diablo está en mis pantalones! ¡Mire, mire!
Real Mentats use only 100% pure, unfooled around with Sapho Juice(tm)!
SELECT * FROM User WHERE Clue > 0
0 rows returned
Save an Orange - Use the VCF!
|
|
|
|
|
I use strtod for this. Use the second parameter as an errorcheck.
char *stopstring = NULL;
char *number = "1.23e4";
double Double = strtod(number, &stopstring);
ASSERT (stopstring != number);
ASSERT (*stopstring == NULL);
ASSERT (Double == 12300.0);
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" - mYkel - 21 Jun '04
"There's not enough blatant self-congratulatory backslapping in the world today..." - HumblePie - 21 Jun '05
Within you lies the power for good - Use it!
|
|
|
|
|
|
Hi,
How can I display an Open/Save File dialog (using CFileDialog) with the initial directory is 'My Computer'? I tried using SHGetSpecialFolderPath with param CSIDL_DRIVES, but the return string is _T(""), and the CFileDialog object seems not to understand an empty string in m_ofn.lpstrInitialDir. It ususally starts with the current directory.
Please help me do this little thing.
Thanks in advance.
|
|
|
|
|
use SHGetFolderPath instead
From the docs: "This function is a superset of SHGetSpecialFolderPath, included with earlier versions of the Shell. On systems preceeding those including Shell32.dll version 5.0 (Windows Millennium Edition (Windows Me) and Windows 2000), SHGetFolderPath was obtained through SHFolder.dll, distributed with Microsoft Internet Explorer 4.0 and later versions. SHFolder.dll always calls the current platform's version of this function. If that fails, it will try to simulate the appropriate behavior. SHFolder.dll continues to be included for backward compatibility, though the function is now implemented in Shell32.dll."
|
|
|
|
|
Thanks, but it appears that SHGetFolderPath doesn't work with param CSIDL_DRIVES. The return string is empty.
Sincerely,
|
|
|
|
|
what is the return value of SHGetFolderPath?
pszPath
[out] Pointer to a null-terminated string of length MAX_PATH which will receive the path. If an error occurs or S_FALSE is returned, this string will be empty.
Return Value
Returns standard HRESULT codes, including the following:
S_FALSE SHGetFolderPathA only. The CSIDL in nFolder is valid, but the folder does not exist. Note that the failure code is different for the ANSI and Unicode versions of this function.
E_FAIL SHGetFolderPathW only. The CSIDL in nFolder is valid, but the folder does not exist. Note that the failure code is different for the ANSI and Unicode versions of this function.
E_INVALIDARG The CSIDL in nFolder is not valid.
|
|
|
|