|
The code snippet in the post is from me. And I wanted to cast the HANDLE to WPARAM .
Michel
If I am wrong or said something stupid, I apologize in advance
|
|
|
|
|
That's ok..........
Thanks all..............
|
|
|
|
|
There is only one type of thread. Concetrate on the error message. You are passing a parameter as a HANDLE where an unsigned int is called for. Try passing an unsigned int.
|
|
|
|
|
Hi,
How can I pass an HGlobal structure from my client App to my COM server ( I´m using TLB's) ?
Thanks, Bye !
Braulio
Ps.: Is legal to pass that HGlobal if there are in different process spaces ?
|
|
|
|
|
Yes you can pass the HGLOBAL to a different process. Just make sure that the HGLOBAL is delcared with GMEM_MOVABLE flag, and then when you want to use the pointer call GlobalLock on the HGLOBAL and cast the return value to your pointer type.
As far as passing the handle to a different process, you could simply pass the handle through a member function of you COM object, however if you want your object to be very robust, I would look into the IDataObject interface.
|
|
|
|
|
Hi Kilowatt,
I´m trying to pass that HGlobal as a parameter stored in a variant ( VT_I4 ( long)), but it didn´t work , I´m using something wrong ? Maybe another type ?
I'm using TLBS so I need to use the standard types. Did you have any good link about how to use the IDataObject thing ? ( I tried to look for something and it was quite confusing).
Thanks a lot, Bye !
Braulio
|
|
|
|
|
I my app I require users to login. Each user may have different privileges
in it. But I don't want to force users to logging twice : 1st to NT then to my app. What can I do? I think I want these settings for user privileges in my app to be manageable in NT somewhere. Like an extension to local security policy or something. It also would be nice to be able to set it for a user once on a domain. Does anybody know what's the best way to do this? Where and what to look for? Thanks a lot.
|
|
|
|
|
Maybe you should just check if current user is member of some given group? Like 'false_vapor_users'?
Tomasz Sowinski -- http://www.shooltz.com ** If you're going to rape, pillage and burn, be sure to do things in that order. **
|
|
|
|
|
Yeah. But how can I setup privs. for user and/or group for specific operations in my app. Like one user can use this and this tab but can not this. And other can use all of them. Stuff like that.
|
|
|
|
|
This scenario assumes that 'user has a privillege to perform X' equals to 'user belongs to NT group named groupX'.
So you have to chose and hardcode some group names, and later assign your users to these groups. For example, if your app does two things - stirr and shake - you'll have two groups: coolAppGroup_stirrers and collApp_shakers. If user Bob is going to perform stirring, he has to be assigned to coolAppGroup_stirrers.
Tomasz Sowinski -- http://www.shooltz.com ** If you're going to rape, pillage and burn, be sure to do things in that order. **
|
|
|
|
|
All this means that the app should store somewhere the list of users from NT whichh I want to avoid. Because each time there is a new user in the NT list I have to add new user in my app.
|
|
|
|
|
Sorry, you're not getting it (yet). There's no list of users in your app. When your app is about to perform stirring, you're checking if current NT user is a member of NT group named coolApp_Group_stirrers.
So one more time (slowly): there... is... no... list... of... users...
Tomasz Sowinski -- http://www.shooltz.com ** If you're going to rape, pillage and burn, be sure to do things in that order. **
|
|
|
|
|
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA!!!!
I see! That's interesting. Kinda cool too! Thanks!
|
|
|
|
|
On the other hand if I have like 158 privs. - that's a lot of groups.
|
|
|
|
|
inner wrote:
On the other hand if I have like 158 privs. - that's a lot of groups.
Yes. But do you really have 158 privs?
Tomasz Sowinski -- http://www.shooltz.com ** If you're going to rape, pillage and burn, be sure to do things in that order. **
|
|
|
|
|
if you relay on NT authentication just call GetUserName and assign privileges according the output..
|
|
|
|
|
I can get user name, but how do I know what this user is allowed to do in my app and what not?
|
|
|
|
|
I am trying to use the shell commands to put a shortcut on my desktop. I want this to work for Nt and ... for all users. How would I do this? NT and Win98 for example has different places and also it is possible that it is not C: but D: directory. Is there an easy way?
I need a "C://..." or whatever to state where this desktop directory is.
THanks.
|
|
|
|
|
char szDesktopPath[MAX_PATH]="";
if(!CoInitialize(0)){
LPMALLOC pMalloc;
if(SUCCEEDED(SHGetMalloc(&pMalloc))){
LPITEMIDLIST pidl;
if(SUCCEEDED(SHGetSpecialFolderLocation(NULL,CSIDL_DESKTOP,&pidl))){
SHGetPathFromIDList(pidl,szDesktopPath);
pMalloc->Free(pidl);
}
pMalloc->Release();
}
CoUninitialize();
}
Admittedly, a little convoluted
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Check the following files "test.h" and "test.cpp".
When using the following code, Class View does not identify the constructor correctly,
and displays it as Global() and not as test().
If Global is defined in the same file ( test.cpp ), the bug does not occur.
Does anybody know of a solution to this bug?
test.h
-----
#define Global __declspec(dllexport )
test.cpp
------
#include "test.h"
class test {
Global test();
};
Shai Gutner
shai.gutner@schema.com
|
|
|
|
|
I built a WebService in C# and consumed it in VC. All works on the machine with VS.Net, but fails on the client machine after the install. I have included both msvcr70.dll and mfc70.dll with the install. Any suggestions as to what I'm missing?
|
|
|
|
|
I have an SDI application. When WM_CLOSE message is received by CMainFrame, I want to check a flag bSthInProcess. I want the application to exit only when this flag is clear. So I coded
LRESULT CMainFrame::WindowProc(UINT message, WPARAM wParam, LPARAM lParam)
{
if ( message == WM_CLOSE )
{
CMyView *pView = (CMyView *)(GetActiveView());
if (pView->bSthInProcess)
MessageBox("wait while exiting.. ");
while ( pView->bSthInProcess )
Sleep(2);
}
return CFrameWnd::WindowProc(message, wParam, lParam);
}
the problem is, if I use MessageBox(), use have to click on the OK button. I want a message which will display the message, and close itself when the application closes.
How could I code it?
Thank you very much!
|
|
|
|
|
You may want to use a modeless, custom dialog box.
Michel
If I am wrong or said something stupid, I apologize in advance
|
|
|
|
|
Thank you, this works.
but, is there any easier way to do it? I mean, is there any API funciton like MessageBox()?
|
|
|
|
|
You will have to do a custom modeless dialog box because MessageBox is a modal dialog box function. There are no other quick APIs to creating a message box.
|
|
|
|