|
Here's a little problem I stumbled on recently. On start-up my application brings up the following error:
The procedure entry point CheckTokenMembership could not be located in the dynamic link library ADVAPI32.dll.
Depends shows that it's actually Msvfw32.dll that calls the function mentioned in the error. This is linked at load-time. The problem occurs only on one machine (NT4SP6), which contains slightly newer versions of the aforementioned DLLs than my own machine. I must admit that I don't really understand DLL initialization that well. Matt Pietrik has written a couple of good articles on the subject (MSDN; Under The Hood), but if you have any ideas, I'd appreciate any help.
-- Rubio
|
|
|
|
|
Rubio,
The error means pretty much what is says. It is unable to find the method "CheckTokenMembership" in the ADVAPI32.dll. You have already narrowed down the problem by identifying the fact that this only occurs on one machine with NT4SP6. What you need to do now is research the changes that have occurred by version on ADVAPI32.dll and consider redistributing this DLL with your executable. Check the redistribution rights first and if you are allowed to redistribute the dll then simply put it in your local directory to resolve the problem.
Hth,
Cliff
Success is measured by ones ability to mask complexity with simplicity.
|
|
|
|
|
Read the docs on that API and you'll find:
Windows NT/2000: Requires Windows 2000.
Your app is using an API that isn't present on NT 4.
--Mike--
"There are three things I can never remember, 1: um... 2: um... 3: um..."
-- Victor Borge
My really out-of-date homepage
Sonork - 100.10414 AcidHelm
Big fan of Alyson Hannigan and Jamie Salé.
|
|
|
|
|
Hmmm - i think CheckTokenMembership is new to Win 2000, so I'd venture that some app installed a bad copy of msvfw32.dll on that NT machine.
Its a video for windows helper lib - I _think_ its not native to the OS, and some mulimedia apps may ship with their own copy...
|
|
|
|
|
Hi there,
I would like to be able to invoke the "send message to contact window" of msn messenger from an About Dialog Box... Msn Messenger is of course supposed to be running and logged in.
The same thing could be great also with Yahoo Messenger...
Does anybody know how to do that ?
I heard about the IM interface from Exchange Server SDK... but don't know how to do...
Thanks
Octopussy
|
|
|
|
|
|
CComPtr<IMessenger>pIM;
CComPtr<IDispatch>pdispWindow;
pIM.CoCreateInstance ( CLSID_Messenger, NULL, CLSCTX_LOCAL_SERVER );
pIM->InstantMessage ( CComVariant("contactname@hotmail.com"), &pdispWindow );
--Mike--
"There are three things I can never remember, 1: um... 2: um... 3: um..."
-- Victor Borge
My really out-of-date homepage
Sonork - 100.10414 AcidHelm
Big fan of Alyson Hannigan and Jamie Salé.
|
|
|
|
|
Ok,
thanks for your answer.
But could you be more precise regarding wich files I have to include or wich SDK I have to install cause I can't compile your code.
Also, I tried to find the COM object of MSN Messenger but with no success!
Regards!
|
|
|
|
|
|
Thanks very much for your precious help. I think I'll send a post to codeproject in order to publish a little class to instant message someone through MSN MESSENGER.
Regards.
Octopussy
|
|
|
|
|
I'm trying to create an MDI application to play around with OpenGL. I'm using the instructions at this link
http://www.codeproject.com/opengl/glenabledview.asp
under where it says:
Use
This article uses the trackball code introduced in the companion article A virtual trackball rotation controller .
To start experimenting OpenGL drawing you just need to follow these steps:
But its not working for me. Can someone possibly give me more elaborate instructions, I'm not sure what I'm doing wrong.
|
|
|
|
|
I didn't see it ,but it is better put message there,so author will help you.
Mazy
"So,so you think you can tell,
Heaven from Hell,
Blue skies from pain,...
How I wish,how I wish you were here." Wish You Were Here-Pink Floyd-1975
|
|
|
|
|
If somebody have sourse for transformation registry in win9x or win2k in txt format... please help me... I need it very much...
|
|
|
|
|
|
try this one :
regedit.exe /e "%temp%\reg.txt" "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run"
it's ugly but it's works..
|
|
|
|
|
Does anybody have an example how to use the 'IUserNotification' Interface ?
thanx
|
|
|
|
|
I want to prevent users from resizing certain columns in a ListCtrl (like MS Outlook prevents the Attachments column in the inbox).
How can I prevent it?
TIA and regards
Andrew Hirst
|
|
|
|
|
|
I was working on one of my projects and faced this problem:
I got a function that receives a LPTSTR parameter. This parameter can be a string, representing a file, or a resource (result of the MAKEINTRESOURCE).
It´s something like this:
void (LPTSTR lpszFile)
{
DWORD dwSize = strlen(lpszFile);
}
The problem is that if this string is the result of the MAKEINTRESOURCE macro, it´s not REALLY a string... it´s an resource ID. If I call strlen with this as a paremeter I´ll get a Access Violation.
The question is, how can I figure out if a string is a string or a resource Id ? I find a MACRO in MSDN docs called IS_INTRESOURCE but I tried to use it and it states that this macro is not defined. I checked the winuser.h and it´s not there. I don´t use the latest version of Plataform SDK, but I assume that this macro is defined there. Can someone gimme the definition of this macro or some other way to figure out if the string is really a string ?
Mauricio Ritter - Brazil
Sonorking now: 100.13560 Trank
|
|
|
|
|
Seen as a DWORD , an ID fake LPTSTR has its high order word set to zero:
inline bool is_resource_string(LPCTSTR lpctstr)
{
return (reinterpret_cast<DWORD>(lpctstr)&0xFFFF0000U)==0;
} (sort of, didn't try this).
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Mauricio
MAKEINTRESOURCE returns a LPTSTR. But it should only be passed to resource functions. The best thing would be to re-prototype your function as :-
void blah(LPTSTR lpszFile,BOOL IsResource)
{
if(!IsResource)
{
DWORD dwSize = strlen(lpszFile);
}
}
My most recent CP article :-
A newbie's elementary guide to spawning processes
www.busterboy.org
|
|
|
|
|
Nish [BusterBoy] wrote:
MAKEINTRESOURCE returns a LPTSTR. But it should only be passed to resource functions. The best thing would be to re-prototype your function as :-
That´s the solution I found... but that macro could be really usefull.
Tks Nish
Mauricio Ritter - Brazil
Sonorking now: 100.13560 Trank
|
|
|
|
|
Hi,
Is there a "right" way for me to communicate with a CWinThread object???
My new, UI threaded smtp daemon now works like the following:
1. Primary thread has listening socket. In OnAccept(), I use a plain CAsyncSocket object to accept the new connection. I then detach this object from the socket in order to get the SOCKET of the connected socket.
2. Still in OnAccept, a AfxBeginThread a new instance of my CWinThread derived class. I set a member of this object to the SOCKET identifier i received on the Detach().
3. In my CWinThread classes initinstance(), i attach a member socket to the SOCKET i just shoved into the class.
Suprisingly, this seems to work. CWinThread's InitInstance doesn't seem to get called until after my OnAccept function has returned, hence the SOCKET handle in the CWinThread class is valid. But, it strikes me that this is pure fluke, the CWinThread could init itself at any time.
I thought about using a MUTEX to block the new threads execution in InitInstance, and release the mutex from the OnAccept function when i had finished detaching. But this seems crap too, since I'd have to use a named Mutex, because I cannot pass a handle to the CWinthread for the same reasons I can't get it a SOCKET.
Is there a better way to set up this object? An ideal way I think would be to have an overloaded constructor in the CWinThread derived class. But I *think* I can't do this becuase the class is dynamically created with RUNTIME_CLASS. Or is there a way to pass arguments to an overloaded constructor with dynamic creation????
Thanks
Jon
Sorry to dissapoint you all with my lack of a witty or poignant signature.
|
|
|
|
|
A safe way to perform object transfer is to create the thread with flag CREATE_SUSPENDED , do the transfer and then call CWinThread::ResumeThread .
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Perfect!
That is ideal, thanks again Joaquin
Sorry to dissapoint you all with my lack of a witty or poignant signature.
|
|
|
|