|
No, I'm definitely specifying the user profile and password if necessary. They are passed as the first two parameters to the Logon method via MAPI's IDispatch interface. I know it works just fine as an NT service because, as I said, replacing the CDO code with Extended MAPI, works fine. Unfotunately, if I were to use Extended MAPI there is a lot of extra work to do replacing all the existing code...
"The folly of man is that he dreams of what he can never achieve rather than dream of what he can."
"If you think education is expensive, try ignorance."
|
|
|
|
|
Sorry, I mean 'user's profile' in the sense of the registry entries under HKEY_USERS and mapping HKEY_CURRENT_USER to the appropriate key under HKEY_USERS . This is not done for a batch, service or network logon, it's only done by USERENV.EXE for an interactive logon.
|
|
|
|
|
That's not a problem. I specify the MAPI_EXPLICIT_PROFILE flag. All I need to do then is specify a valid profile and password if required.
"The folly of man is that he dreams of what he can never achieve rather than dream of what he can."
"If you think education is expensive, try ignorance."
|
|
|
|
|
Converting std::wstring to std::string and the other way around, anyone knows a good way to do this? :>
|
|
|
|
|
String Conversion Macros on MSDN will satiates ur need
The chosen One
|
|
|
|
|
I wrote a bunch of functions to do this kind of thing here[^].
"Sucks less" isn't progress - Kent Beck [^]
Awasu 1.1.3 [^]: A free RSS reader with support for Code Project.
|
|
|
|
|
Please help and correct me if I am using the incorrect method (I am only learning). What I am trying to do is save a frame from a buffer to a .bmp file. The buffer contains the bits of a bmp image which is 768 * 576 * 32bit. Here is the code that I have been trying to get to work.
CBitmap FrameBitmap;
CFile myBmpFile("Captures/test.bmp", CFile::modeCreate | CFile::modeReadWrite);
//Create the storing archive.
CArchive arStore(&myBmpFile, CArchive::store);
//Create the CBitmap
FrameBitmap.CreateBitmap(768,576,1,32,pImageBuffer);
if(FrameBitmap.IsSerializable())
{
FrameBitmap.Serialize(arStore);
}
//Close the archive and the file
arStore.Close();
myBmpFile.Close();
Thanks
Dave
|
|
|
|
|
|
You've indicated what you want to do, but have not indicated what is actually happening. Are you getting compiler/linker errors? Is an assertion firing? Have you single-stepped through the code to see what is going on? Something a little more detailed than "Here is some code that is not working." leaves a lot to be desired.
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
I am not getting any errors at all, all that is happening is the test.bmp file is being written to the hard drive its size is 0kb and it will not open in an image editor. It seems like it does not contain any information.
I have also tryed the following method to no avail, this following method creates a valid .bmp file with all the correct dimensions which will open in an image editor, problem is the whole image is black. I am not sure what to do with the RGBQUAD bmPallette[1]; & bmInfo.bmiColors = bmPallette; and i guess this could be the problem in this method:-
BITMAPFILEHEADER bmfHeader;
BITMAPINFO bmInfo;
BITMAPINFOHEADER bmiHeader;
//RGBQUAD bmPallette[1];
bmfHeader.bfType = 0x4D42;
bmfHeader.bfSize = (sizeof(BITMAPFILEHEADER) + sizeof(BITMAPINFO) + (768*576*4));
bmfHeader.bfOffBits = (bmfHeader.bfSize - (768*576*4));
bmfHeader.bfReserved1 = 0;
bmfHeader.bfReserved2 = 0;
bmiHeader.biBitCount = 32;
bmiHeader.biClrImportant = 0;
bmiHeader.biCompression = BI_RGB;
bmiHeader.biHeight = 576;
bmiHeader.biPlanes = 1;
bmiHeader.biSizeImage = 0;
bmiHeader.biWidth = 768;
bmiHeader.biClrUsed = 0;
bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
bmiHeader.biXPelsPerMeter = 2834.6;
bmiHeader.biYPelsPerMeter = 2834.6;
//bmInfo.bmiColors = bmPallette;
bmInfo.bmiHeader = bmiHeader;
DWORD dwBitsSize = bmfHeader.bfSize;
CFile file("Captures/test.bmp", CFile::modeCreate | CFile::modeReadWrite);
file.Write((LPSTR)&bmfHeader, sizeof(bmfHeader));
file.Write((LPSTR)&bmInfo, sizeof(bmInfo));
file.Write((LPSTR)&pBuffer, sizeof(pBuffer));
file.Close();
Thanks
Dave
|
|
|
|
|
How to laod C# Form in MFC project?
|
|
|
|
|
You should ask Tom Archer or Nish for that. They are the experts for this.
Sonork 100.41263:Anthony_Yio
|
|
|
|
|
Hi There,
I've made a key accelerator table, and I've linked this one to my app. But how do I associate the message from the accelerator to a function?
Is this also possible in a dialog based app?
Thanks,
|
|
|
|
|
A keyboard accelerator generates (through the ::TranslateAccelerator function) a WM_COMMAND message with the identifier you've assigned in the accelerator table.
In MFC, CFrameWnd::PreTranslateMessage calls ::TranslateAccelerator for you. Handle the message with an ON_COMMAND macro. For a raw API application, you should add a call to TranslateAccelerator in your message loop and handle the message in your window's window procedure.
For an MFC dialog-based application, override PreTranslateMessage and add a call to TranslateAccelerator . Again, handle with ON_COMMAND .
Note that menu items, command buttons, toolbar buttons and accelerators all generate WM_COMMAND messages. You should assign all items in the above categories which perform the same operation the same identifier (e.g. ID_FILE_SAVE for the File > Save menu item, the Save button in the toolbar, and the Ctrl+S key combination).
|
|
|
|
|
hi,
i want to use the function StrRetToStr(...) in a Console Application, i have included the corresponding file Shlwapi.h and the library Shlwapi.lib but the function isn't declared in them ? is this a bad joke from microsoft ??
Does this function exist at all ?
Thanks in advance !
|
|
|
|
|
Hi,
What IE version u have ?
Use the func below. Check if same thing happening with this also
StrRetToBuf
The chosen One
|
|
|
|
|
StrRetToBuf also doesn't exist/work !
|
|
|
|
|
What @ IE version u r having on ur machine?
The chosen One
|
|
|
|
|
|
i have the one which came with VS6!
Can you give me a favour, and send me the shlwapi.h which came with the SDK ?
Thanks in advance!
|
|
|
|
|
All these functions are exported from Shlwapi.dll (7/24/2002) as (ASCII: StrRetToBufA, UNICODE: StrRetToBufW etc)
If not included in your version of Shlwapi.h you could consider checking in the latest W32 SDK (note that the standard MSDevStudio files are usually quite out of date).
Quick solution might be to add its declaration yourself in your code.
You would need of course to make sure that the right version of Shlwapi.dll is installed on the target system
|
|
|
|
|
After using VS.NET c++ for several hours and doing many "find in file" operations. Find in files will hang at the begining of a search and you will not be able to interrupt it. If subsequently you try to do a normal Find the whole application hangs.
Has anyone else noticed this?
I seen a newspost saying that pressing ctrl scroll
lock may fix this, but I tried that and it does not work.
I am using Microsoft Development Environment 2003 Version 7.1.3088 under Windows XP.
|
|
|
|
|
Hi.
I'm using FindFirstChangeNotification to get an event about a new file being created in a specific directory. for some odd reason, calling DeleteFile on that file doesn't do anything.
Even when calling the deleteFile after calling CloseChangeNotification.
Any idea ?
|
|
|
|
|
Have you tried using ::GetLastError() after the delete to check why it fails? Also from memory you can't delete r/o files.
Neville Franks, Author of ED for Windows. Free Trial at www.getsoft.com
|
|
|
|
|
Is the file on your local drive or on a network drive? I could not get it to work on a network drive, only on my local c: drive. I have found some articles on the internet that says it works with network drives and other articles that says it does not work with network drives.
|
|
|
|