|
Ryan McDermott wrote:
I dont really want to use MFC.
MFC is not required, and would really be overkill anyway.
Ryan McDermott wrote:
I dont know if that code was MFC or not.
Which code?
Ryan McDermott wrote:
I was wondering if its possible to convert an exe to a cpl file. I want code that converts the exe to a cpl.
What do you mean by "converting?" The three requirements are that the applet must be a DLL, it must have a .CPL extension, and it must export a CPlApplet() function. My suggestion would be to create an application that met all three of these requirements. When CPlApplet() was called with a message such as CPL_DBLCLK , you would then use CreateProcess() to start the .EXE. Make sense?
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
yes now it does. Thanks I can be dumb sometimes
-Ryan M.
|
|
|
|
|
Ryan McDermott wrote:
I can be dumb sometimes
I doubt it. Lack of experience is not the same as inability to learn.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
We have an application ("A") that pushes another application ("B") to target system and schedules it to be run by the Microsoft scheduler using credentials supplied by the user of "A". Whew! The first thing "B" does when it is fired off by the scheduler is to give the logged in user the ability to cancel the task ("B", that is) by virtue of a popup dialog. The problem is when the logged-in user is different from the user account that the task is scheduled to run as (usually 'administrator') the dialog doesn't appear (under Windows 2003) or parts of the dialog are transparent (under XP). Our task "B" does not who the logged user is.
Basically, the algorithm is:
1) LookupAccountName() with an empty user to get back the SID for the BUILT-IN domain.
2) GetProcessWindowStation()to get this thread's window station. Used later on exit to restore things
3) GetCurrentThreadId() to be used in...
4) GetThreadDesktop() to get this thread's desktop. Used later on exit to restore things
5) OpenWindowStation(L"winsta0", true, MAXIMUM_ALLOWED)to get the 'default' window station.
6) OpenInputDesktop(DF_ALLOWOTHERACCOUNTHOOK, true, MAXIMUM_ALLOWED) to get the desktop that is being used.
7) We make sure that SID that we retrieved from the call to LookupAccountName() is in the ACL for the window station we got from the call to OpenWindowStation().
8) We make sure that SID that we retrieved from the call to LookupAccountName() is in the ACL for the desktop we got from the call to OpenInputDesktop().
9) SetThreadDesktop() with the desktop we go back from OpenInputDesktop().
10) Popup our dialog.
11) Restore everything back to the way is was on the way out.
All the API calls return good values.
This works when the logged-in user is the same as the user that task "B" is scheduled to be run as. It doesn't when they're different.
Am I missing a step? What do I have to do to work with Windows 2003? I know that there was some new security features added. They seem to be hosing me up.
I've tried a hundred different permutations of getting/setting security attributes. None made a real difference.
Spike McFarland
|
|
|
|
|
I just noticed a mistake as soon as I posted:
Between steps 5 and 6 I call SetProcessWindowStation()
with the handle returned by OpenWindowStation().
Spike McFarland
|
|
|
|
|
hai,
If I want to create my own message box in my application instead of using MessageBox(), how do I do that .Do I have to create another dialog with a statictext and change its text each time? Is there any easy way to do it?
Thanks a lot in advance.
|
|
|
|
|
magee81 wrote:
If I want to create my own message box in my application instead of using MessageBox(), how do I do that .Do I have to create another dialog with a statictext and change its text each time?
Yes, that's the general recipe.
magee81 wrote:
Is there any easy way to do it?
That's about as easy as it gets.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
|
|
Hi, i want to split a line from a text file which i don't know it's length just i know that line has this format:
Welcom:2004-9-5:4 :1:23
but the numbers can be one digit or 2 and that is why i don't know the length. i will just parse line and will read it.
will appreciate any help, specially with few lines of code
really thank you
|
|
|
|
|
One way is with AfxExtractSubString() . Another is with strtok() .
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
thanks but can you explain more (alittle bit )
really thank you
|
|
|
|
|
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vclib/html/_crt_strtok.2c_.wcstok.2c_._mbstok.asp
http://support.microsoft.com/default.aspx?scid=kb;en-us;200421
http://www.codeproject.com/string/split_cstring.asp?df=100&forumid=14815&exp=0&select=442099
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
thank you for information but my problem is that i have the file with more than 100 lines and i have to read and seprate each line with delim.
I can read each line and save it in string ptr but how to check it with a char ",".
really thank you
|
|
|
|
|
Oriocat wrote:
...but my problem is that i have the file with more than 100 lines...
It matters not if you are processing 10 lines or 10,000 lines, both of the functions I suggested can be used. After each line is read, simply call one of the functions the appropriate number of times.
BTW, is this an MFC application?
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
VC++.net
then if my line is pointer of string still those functions will work?
really thank you
|
|
|
|
|
Oriocat wrote:
VC++.net
Which has no bearing on whether it is an MFC application or not. If it is, AfxExtractSubString() can be used, whereas strtok() cna be used in either case.
Oriocat wrote:
then if my line is pointer of string still those functions will work?
That depends on what "pointer of string" is.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
what i have for getting the line is:
StreamReader* sr = new StreamReader("file.txt");
String *L = ""; //for putting each line on it
L = sr->ReadLine();
// and then i will use ArrayList to save each line
// with while loop i read line by line
now my question is how should i use L in that function?
thank you
|
|
|
|
|
I've not ever used a String object, but a cursory glance shows me it has no methods for accessing the internal object (much like the LPCTSTR operator of CString ).
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
String *L = ""; //for putting each line on it
what data type is String?
you are creating a pointer to an object and assigning it a value. I dont think this will work. Mabey it should be like this
String L = "";
if this data type is really stl::string then you can call c_str() to get a const char ptr and pass that to strtok
|
|
|
|
|
i created a doc/view app without using the wizard.the problem i am having is that the child windows don't display any title at all. the shared resource string is ok - i substituted it in a Wizard generated app. and it works fine there. my app handles ID_FILE_NEW and brings up a dialog on ID_FILE_OPEN.
do i have to include/or override something that i am overlooking ?
thanks
|
|
|
|
|
Hello...I'm a newbie in c++ win32 programming. I'm trying to create a bitmapped button in my dialog. The bitmap is already in my resource and I have checked the enable bitmap under the properties of the button.
What do i do next?
Pls help! thanks!
|
|
|
|
|
See if either of these two links are of any help:
http://flounder.com/bitmapbutton.htm
http://www.codeproject.com/buttonctrl/
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Here u go,
HANDLE hCalBmp = LoadBitmap( hInst , MAKEINTRESOURCE(IDB_BITMAP) ) ;
SendMessage( GetDlgItem( hDlg, IDC_CALIBRATE ), BM_SETIMAGE, (WPARAM)IMAGE_BITMAP, (LPARAM)hCalBmp ) ;
Try this in INITDIALOG.
Hope this helps.
|
|
|
|
|
I have a Windows 2003 Server (Standard) and Visual Studio 6.0 with Service Pack 6 installed.
I try to work on a MFC project, but every 15 minutes or so I get an error message box "MSDEV.EXE could not locate \device\harddisk\0" and the MSDEV is locked up
I can bring up task manager and kill the process, but this is affecting productivity
My hard drives are letered F: and G: instead of the traditional C: and D:
Is this the problem? Has anyone else seen this and worked around it?
Is it a 'tightened' security issue?
I am logged in as a member of the local administrators group.
I am pretty sure I installed the Visual Studio while logged in under this development account as well.
Thanks for any ideas
|
|
|
|