|
if it would be an error, it would say "error", not "warning"... maybe you have another error
|
|
|
|
|
My MSAA Hook dll is expected to be loaded into all process's memory. in 32 bits Win7 it works.
But in win7 64 bits some process can load MSAAHook.dll 64 bits cannot be loaded into some 64 bits process. Why does this happens?
= ::SetWinEventHook(EVENT_MIN,
EVENT_MAX,
m_hModule,
MSAAHook::WinEventProc,
0,
0,
WINEVENT_INCONTEXT | WINEVENT_SKIPOWNTHREAD);
|
|
|
|
|
A Windows process has to be homogeneous; you can't mix 32-bit and 64-bit code in a single process, Windows can't handle that. If your DLL works fine in a 32-bit environment, you'll need another one to get it working in a 64-bit world.
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
|
|
|
|
|
actually, I have 64 bits hook dll for 64 OS. but this 64 bits hook dll cannot be hooked into all 64 bits process. I changed to source code, and give the SetWinEventHook function the process ID, but it still cannot set hook into the process. So I am very confused about this.
|
|
|
|
|
Hi,
I am able to write & read the data from serial port using buffer length pre specified. Is there any way by which I can read continous stream of data from serial port. I have tried to read the data from serial port using "ReadFile ()" in a while (1) {} loop. But my ReadFile () get blocking and I am not getting data after first read of buffer lenght is done.
|
|
|
|
|
Read here for serial port pointers.
"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
|
|
|
|
|
Thanks a lot . Its really a nice article
|
|
|
|
|
It is, except for the horrible background color.
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
|
|
|
|
|
|
hi all,
please help me to create update and delete registry in mac os if its possible please help me for this.
thanks in advance.
|
|
|
|
|
Is it a C++ question ??
Please post your question Here[^].
"Every Little Smile can touch Somebody's Heart...
May we find Hundreds of Reasons to Smile Everyday... and
May WE be the Reason for someone else to smile always!" (ICAN)
|
|
|
|
|
You should start by finding out what sort of registry MAC OS uses; Google seems to believe that it does not have one - see here[^].
The best things in life are not things.
|
|
|
|
|
i want to use a days trial version option for my application.
please help me what can i implement it in MAC.
in windows i easily place the date value in registry and calculate the valid trial days.
so its working fine in windows.
please tell me some thing similar about this in mac.
|
|
|
|
|
|
Er, did you read the other answers?
The best things in life are not things.
|
|
|
|
|
There is no registry on Mac OS.
The equivalent to the registry is the "plist" (http://en.wikipedia.org/wiki/Property_list[^]).
You could use a "dot file" file to store data; those files are usually text files, but this is not standard Mac OS behaviour.
Watched code never compiles.
|
|
|
|
|
Although i am using Delphi the question can
be applied to c++ too.
If i have a .lnk file
that point to a link of http://.... type
HOW do i get the string http://.....
using IShellLink
GetPath or GetDescription or any thing else
do not give me a solution.
the GetWorkingDirectory give me system32 as path
but i want the string http://.....
any help???
|
|
|
|
|
There is a difference in .lnk and .url file. If you have .lnk file than it is a shortcuts of any file like .gif file and .exe file etc. If you have a .url file than it is a shortcut of any url like http://www.codeproject.com.
If it is .lnk than you can get the path of file by using GetPath
->[^]
If it is .url than you can get the path of URL by using GetURL ->[^]
"Every Little Smile can touch Somebody's Heart...
May we find Hundreds of Reasons to Smile Everyday... and
May WE be the Reason for someone else to smile always!" (ICAN)
|
|
|
|
|
No try and you will see you are wrong
I get blank on getpath!!!!!
And on GetWorkingDirectory i get system32 as the path!!!
|
|
|
|
|
limelect wrote: No try and you will see you are wrong
I already tested it and than give you suggestion.
Okie right click the .lnk file and check its tab: Is it "General", "Shortcut", "Security"?? If so than check in "Shortcut" tab there is one value on "Target".
Is it the value what you want?? "http://...".
"Every Little Smile can touch Somebody's Heart...
May we find Hundreds of Reasons to Smile Everyday... and
May WE be the Reason for someone else to smile always!" (ICAN)
"Your thoughts are the architects of your destiny."
|
|
|
|
|
Yes the target
Ok but now what function read it?
I could not find any
Since in "normal situation" the getpath
give the info needed
But on this case i tried all known functions
could not find one!!! that is the problem
|
|
|
|
|
Please share your code.
"Every Little Smile can touch Somebody's Heart...
May we find Hundreds of Reasons to Smile Everyday... and
May WE be the Reason for someone else to smile always!" (ICAN)
"Your thoughts are the architects of your destiny."
|
|
|
|
|
It is a Delphi code but the sintax is the same
I have 2 code
second one is from jvcl
There are so many codes around i checked many none work for .lnk
I tried c++ code too
There is NO!! mistake in the code only to get the right function
to do the job
And This one dose not do the job either
http://www.codeproject.com/KB/shell/create_shortcut.aspx
var
IObject : IUnknown;
ISLink : IShellLink;
IPFile : IPersistFile;
p:PItemIDList;
TargetName : WideString;
LinkInfo: TShellLinkInfoStruct;
s: string;
AStr: array [0..MAX_PATH] of Char;
begin
TargetName:='C:\Documents and Settings\Administrator\Desktop\AVS Video Converter HD. Perfect for home video conversion. Convert video fast and easily!.lnk';
IObject := CreateComObject(CLSID_ShellLink) ;
ISLink := IObject as IShellLink;
IPFile := IObject as IPersistFile;
ISLink.SetPath(pChar(TargetName)) ;
{ Load file into IPersistFile object }
IPFile.Load(PWideChar(TargetName), STGM_READ);
{ Resolve the link by calling the Resolve interface function. }
ISLink.Resolve(0, SLR_UPDATE{ANY_MATCH} {or SLR_NO_UI});
{ Get all the info! }
ISLink.GetPath(AStr, MAX_PATH, LinkInfo.FindData, SLGP_RAWPATH);
ISLink.GetWorkingDirectory(AStr, MAX_PATH);
__________________________JVCL CODE __________________________________________
procedure GetShellLinkInfo(const LinkFile: WideString; var SLI: TShellLinkInfo);
{ Retrieves information on an existing shell link }
var
SL: IShellLink;
PF: IPersistFile;
FindData: TWin32FindData;
AStr: array [0..MAX_PATH] of Char;
begin
OleCheck(CoCreateInstance(CLSID_ShellLink, nil, CLSCTX_INPROC_SERVER,
IShellLink, SL));
{ The IShellLink implementer must also support the IPersistFile }
{ interface. Get an interface pointer to it. }
PF := SL as IPersistFile;
{ Load file into IPersistFile object }
OleCheck(PF.Load(PWideChar(LinkFile), STGM_READ));
{ Resolve the link by calling the Resolve interface function. }
OleCheck(SL.Resolve(0, SLR_ANY_MATCH or SLR_NO_UI));
{ Get all the info! }
with SLI do
begin
OleCheck(SL.GetPath(AStr, MAX_PATH, FindData, SLGP_SHORTPATH));
PathName := AStr;
OleCheck(SL.GetArguments(AStr, MAX_PATH));
Arguments := AStr;
OleCheck(SL.GetDescription(AStr, MAX_PATH));
Description := AStr;
OleCheck(SL.GetWorkingDirectory(AStr, MAX_PATH));
WorkingDirectory := AStr;
OleCheck(SL.GetIconLocation(AStr, MAX_PATH, IconIndex));
IconLocation := AStr;
OleCheck(SL.GetShowCmd(ShowCmd));
OleCheck(SL.GetHotKey(HotKey));
end;
end;
|
|
|
|
|
Is your Target name is the folder where your .lnk file is placed ??
It should be the full path of .lnk file
Example : "c:\\abc\\file.lnk".
The example given in this link is same that I will give you.
How to create and resolve a shortcut[^]
I had created a sample project and it is working fine:
HRESULT CMy1Dlg::ResolveIt(HWND hwnd, LPCSTR lpszLinkFile, LPWSTR lpszPath, int iPathBufferSize)
{
HRESULT hres;
IShellLink* psl;
WCHAR szGotPath[MAX_PATH];
WCHAR szDescription[MAX_PATH];
WIN32_FIND_DATA wfd;
hres = CoCreateInstance(CLSID_ShellLink, NULL, CLSCTX_INPROC_SERVER, IID_IShellLink, (LPVOID*)&psl);
if (SUCCEEDED(hres))
{
IPersistFile* ppf;
hres = psl->QueryInterface(IID_IPersistFile, (void**)&ppf);
if (SUCCEEDED(hres))
{
WCHAR wsz[MAX_PATH];
MultiByteToWideChar(CP_ACP, 0, lpszLinkFile, -1, wsz, MAX_PATH);
hres = ppf->Load(wsz, STGM_READ);
if (SUCCEEDED(hres))
{
hres = psl->Resolve(hwnd, 0);
if (SUCCEEDED(hres))
{
hres = psl->GetPath(szGotPath, MAX_PATH, (WIN32_FIND_DATA*)&wfd, SLGP_SHORTPATH);
if (SUCCEEDED(hres))
{
hres = psl->GetDescription(szDescription, MAX_PATH);
if (SUCCEEDED(hres))
{
hres = StringCbCopy(lpszPath, iPathBufferSize, szGotPath);
if (SUCCEEDED(hres))
{
}
else
{
}
}
}
}
}
ppf->Release();
}
psl->Release();
}
return hres;
}
ResolveIt(this->m_hWnd,"d:\\Documents and Settings\\s.p\\Desktop\\2.lnk",_T("d:\\Documents and Settings\\s.p\\Desktop\\2.lnk"),1024);
"Every Little Smile can touch Somebody's Heart...
May we find Hundreds of Reasons to Smile Everyday... and
May WE be the Reason for someone else to smile always!" (ICAN)
"Your thoughts are the architects of your destiny."
|
|
|
|
|
See in my source it is full path
It is crazy in my Delphi application i Dose NOT work.
i have exactly what you guise have and it dose not work
ON GETPATH
can i get from you a full SMALL application source so
i will compile it here and see the difference!!
I am an expert with Delphi but not 100% c++
I do not understand if you get the string with
getpath why it dose not work on delphi
i have 2 links as you can see in the source one works
ok the other no
I wander if FindData: TWin32FindData; is my problem since
you have it to WIN32_FIND_DATA wfd;
IObject : IUnknown;
ISLink : IShellLink;
IPFile : IPersistFile;
p:PItemIDList;
TargetName : WideString;
FindData: TWin32FindData;
s: string;
AStr: array [0..MAX_PATH] of Char;
begin
TargetName:='C:\Documents and Settings\Administrator\Desktop\AVS Video Converter HD. Perfect for home video conversion. Convert video fast and easily!.lnk';<<<<<< this is not it gives system32 for path
// TargetName:='C:\Documents and Settings\Administrator\Desktop\123FreeSolitaire.lnk';<<<<< this is ok
IObject := CreateComObject(CLSID_ShellLink) ;
ISLink := IObject as IShellLink;
IPFile := IObject as IPersistFile;
ISLink.SetPath(pChar(TargetName)) ;
{ Load file into IPersistFile object }
IPFile.Load(PWideChar(TargetName), STGM_READ);
{ Resolve the link by calling the Resolve interface function. }
ISLink.Resolve(0, SLR_UPDATE{ANY_MATCH} {or SLR_NO_UI});
{ Get all the info! }
ISLink.GetPath(AStr, MAX_PATH, FindData, SLGP_SHORTPATH);<<<<<< the same as yours
ISLink.GetWorkingDirectory(AStr, MAX_PATH);
ISLink.GetDescription(AStr, MAX_PATH);
|
|
|
|