|
yeah, but did you try different parameters for user, domain, and password and are you shure that the process than runs under the RIGHT security context ??
|
|
|
|
|
hph wrote:
did you try different parameters for user, domain, and password
Tried different user, not domain. I have only one computer at home
hph wrote:
are you sure that the process than runs under the RIGHT security context
Check it, if you know how. Or ask Microsoft to send you the source code
I believe that if the function suppose to run a process under right context, it will.
Philip Patrick
Web-site: www.stpworks.com
"Two beer or not two beer?" Shakesbeer
Need Web-based database administrator? You already have it!
|
|
|
|
|
Could it be possible that CreateProcessWithLogonW() only works for Local users? I tried it many times and it works only if the user is a local one!
It seems that a domain, can't be a other workstation(of course)!!
... you can check the security context, if you try to access files! At the error code you can see whether you have the needed rights or not!!
|
|
|
|
|
You are right, look:
From MSDN:
The user account must have Log On Locally permission on the local computer. This permission is granted to all users on workstations and servers, but only to administrators on domain controllers.
Philip Patrick
Web-site: www.stpworks.com
"Two beer or not two beer?" Shakesbeer
Need Web-based database administrator? You already have it!
|
|
|
|
|
Umm... aren't you calling a wide character fn with single char strings? Mebbe leave off the dubya. ( Yes Ravi, its a word now...)
|
|
|
|
|
Oops - my bad - there is no non-wide char version - the strings are LPCWSTR. So, maybe just use the L prefix as in Phillips example.
|
|
|
|
|
I'm a VC++ newbie!
I am trying to read from a pipe and then write the data to a textfile. I can read from the pipe and put the data into my dialog but it won't write the data to a text file. I know that it is opening the file and it does write the test "hello's" but not data from the pipe.
Here is the code that reads from the pipe:
FILE *stream;
char buffer[1024];
.
.
.
stream = fopen( "number", "w" );
fprintf( stream, "Hello\n"); //This goes to the text file
//Read from the pipe
ReadFile(hReadPipe, buffer, 1024, &bytesread, NULL);
fprintf( stream, "Hello2 %s \n", buffer); //Hello2 goes to the text file but nothing else
//send the message from the pipe to the edit box.
SendDlgItemMessage(hDlg, EDIT1, EM_SETSEL, -1, 0);
SendDlgItemMessage(hDlg, EDIT1, EM_REPLACESEL, FALSE, (LPARAM)buffer);
fclose( stream );
|
|
|
|
|
For clarity and possibly function, I would switch and use only one form of all of the functions. I would switch to either CreateFile, ReadFile, WriteFile and CloseHandle or fopen, fread, fwrite, fclose to do your pipe and file handling.
I am not sure that you can use ReadFile to to read data when you open a file with fopen. I believe that you need to use fread and fwrite. To test this you should check the bytes read value from the ReadFile function and insure that it is the size that you expect it to be. I suspect that it will be zero.
There is one other possibility that there is a NULL at the very beginning of your buffer data, and fprintf does not want to display it that way, I don't know.
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
Hi 2 All! I have following question: how can I properly use splitter window in project that created without Doc/View architecture support? Most evidently solution - add object of CSplitterWnd by hands and initialize them within OnCreateClient - fails in a couple mouseclicking Application crash preceded by debug warning message "Warning: create pane without CDocument". Crash occurs in the internals of MFC-code: CFrameWnd::OnCmdMsg
P.S. Sorry for my rough English
|
|
|
|
|
Thanx, it almost works But in this sample any objects of СSplitterWnd are absent at all!!! There is an "manually" implementation . Unfortunaly I need sample based on CSplitterWnd solely.
|
|
|
|
|
At one point in my app, I have a bitmap and an enhanced meta DC I want to copy the bitmap into the meta Dc so that I can copy to the clipboard.
I can't seem to get this to work.
here is my code
if ( OpenClipboard(hdc) )
{
EmptyClipboard();
//create the metafile DC
CMetaFileDC * cDC = new CMetaFileDC();
cDC->CreateEnhanced(GetDC(),NULL,NULL,NULL);
//call draw routine here that makes GDI calls int cDC
// my bitmap is here!!
//close meta CMetafileDC and get its handle
HENHMETAFILE handle = cDC->CloseEnhanced();
//place it on the clipboard
SetClipboardData(CF_ENHMETAFILE,handle);
CloseClipboard();
//delete the dc
delete cDC;
}
I am stumped, any help appreciated
IGeorgeI
George W
|
|
|
|
|
I think you might need to detach the metafile before deleting it:
cDC->Detach();
delete cDC;
BTW: you might as well create the CMetaFileDC on the stack instead of using new .
Also BTW: It is possible to put bitmaps on the clipboard directly.
--------
I'm not sick, but i'm not well
And i'm so hot, 'cause i'm in hell... Harvey Danger, Flagpole Sitta
|
|
|
|
|
Thanks for reply but that didn't work.
I have captured one of my components and saved it in memory as a bitmap. The class that I am using to capture, saves it as a bitmap so I have no choice but to work with bitmaps.
I can already copy it as a bitmap to the clipboard and paste into other applications. That works great.
I want to now copy it into the clipboard as an enhaced meta file.
I have been trying to stretchBlt the bitmap to the EMF but that seems to work sort of but there is offsets and distortion that occurs.
I just want to know if there is a propper way to copy the bitmap to an Enhanced meta file.
I am really stumped here.
IGeorgeI
George W
|
|
|
|
|
Are you asking how to do it?
If so, this is what you need to do:
cDC->CreateEnhanced(hdc,NULL,NULL,NULL);
...
CDC dcMem;
CBitmap *bmpOld;
dcMem.CreateCompatibleDC(hdc);
bmpOld = dcMem.SelectObject(&cBitmap);
BITMAP bm;
cBitmap.GetBitmap(&bm);
cDC.BitBlt(x, y, bm.bmWidth, bm.bmHeight, dcMem, 0,0, SRCCOPY);
dcMem.SelectObject(bmpOld);
...
GoodLuck
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
I have need to add a simple splitter between two controls (could be a CTreeCtrl and a CListCtrl, 2 ListCtrl's, etc) in a dialog box. They need to be both side by side, and one on top of the other (depeding on the dialog).
Is there an existing class that I can use that I am unaware of? If not, does someone have an example of how to get started on this?
Any help is appreciated.
: Karnatos
|
|
|
|
|
Have you checked any of these babies out yet?
Mike Mullikin
Our lager, Who art in barrels, Hallowed be thy drink, Thy will be drunk, (I will be drunk) At home as I am in the tavern, Give us this day our foamy head, And forgive us our spillages, As we forgive those who spill against us, And lead us not to incarceration, But deliver us from hangovers, For thine is beer, The bitter and the lager, Forever and ever, Barmen.
|
|
|
|
|
I'm partial to this one.
--------
I'm not sick, but i'm not well
And i'm so hot, 'cause i'm in hell... Harvey Danger, Flagpole Sitta
|
|
|
|
|
Sounds like it fits the bill - I'll be trying it out!
Thanks for the lead, much appreciated.
: Dean
|
|
|
|
|
It occurs to me, now that i look at it, that the version i'm using has been hacked to allow opaque sizing; if this is something you'd want, mail me & i'll send you a copy.
--------
I'm not sick, but i'm not well
And i'm so hot, 'cause i'm in hell... Harvey Danger, Flagpole Sitta
|
|
|
|
|
Many programs add according shell items for convenience,and then can execute
the corresponding task provieded by the program,this is great.but i am not
sure how to do this,who can help me?
|
|
|
|
|
Check out the articles in this index to see if they can help you:
|
|
|
|
|
Hi
i have a file where each line contains a decimal number (between 0 and 4) and a hexadecimal number between (0 and FFFFFFFF).
what is the best way to read this file and convert the hexadecimal number into a binary number.
thanks
Mohe
|
|
|
|
|
Read my article on ostringstream - it will do this conversion for you. If you're doing file i/o ifstream/ofstream will work in exactly the same way as ostringstring does.
Christian
The tragedy of cyberspace - that so much can travel so far, and yet mean so little.
"But there isn't a whole lot out there that pisses me off more than someone leaving my code looking like they leaned on the keyboard and prayed that it would compile.
- Jamie Hale, 17/4/2002
|
|
|
|
|
Does anyone know the minimum requirements for the .NET framework? CPU, RAM, OS, etc. Thanks
Chris Hafey
|
|
|
|
|
Nevermind, I found it at the download site for the framework redistributable:
Typical Installation Requirements
The .NET Framework runs on:
Microsoft Windows® 98
Microsoft Windows NT® 4.0 (SP 6a required)
Microsoft Windows Millennium Edition (Windows Me)
Microsoft Windows 2000 (SP2 Recommended)
Microsoft Windows XP Professional
Microsoft Windows XP Home Edition
Software Requirements:
Microsoft Internet Explorer 5.01 or later (install Internet Explorer 6.0)
|
|
|
|
|