|
For Win2000+ there is Fax Service Client API - find its documentation in MSDN under Platform SDK.
Sonork 100.15206;PavelK
|
|
|
|
|
I've imported some bitmaps into my project but in Borland there is a way to save the bitmap files into the resource .rc file so that the original bitmap files do not have to be included with the project. Does VC++ have a similar method?
|
|
|
|
|
Well, i guess you can compile the .rc file to a .res file, but that's not very nice since you loose all the #define d names for things then & have to use numbers. But, if you *really* can't be sending around bitmap files, then i guess it might work.
---
Shog9
Actually I use to find learning in bars when drinking really useful.
It sort of makes a language liquid. - Colin Davies, Thinking in English?
|
|
|
|
|
Thanks for the suggestion. What I was talking about though just made the .rc file larger. It had the BITMAP declaration in it followed by the binary data. Have you ever seen one in a .rc file before? It looks like this:
IDB_MYBITMAP BITMAP
{
.
'42 4D 76 2A 01 00 00 00 00 00 36 04 00 00 28 00'
.
}
My question was how to get it into the .rc file. "import" doesn't do it, it just creates a reference to the existing .bmp file in the directory. Of course, then you have to ensure that file is always there instead of in the resource (.rc) file.
|
|
|
|
|
Well, that syntax might work if you edited the .rc file directly; it sorta looks like the syntax for RCDATA sections. But AFAIK, there's no way to do that using Microsoft's resource editor.
---
Shog9
Actually I use to find learning in bars when drinking really useful.
It sort of makes a language liquid. - Colin Davies, Thinking in English?
|
|
|
|
|
I guess I could put the bitmap in a Borland project and it will automatically put it into the .rc file. Then, cut n' paste it into my VC++ project's .rc file, eh?
|
|
|
|
|
Give it a shot! The worst that could happen is it won't compile.
---
Shog9
Actually I use to find learning in bars when drinking really useful.
It sort of makes a language liquid. - Colin Davies, Thinking in English?
|
|
|
|
|
Actually, paste it into the .rc2 file in the VC project. .rc2 holds resources that are compiled but which are not editable by the resource editors.
--Mike--
Just released - RightClick-Encrypt v1.4 - Adds fast & easy file encryption to Explorer
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
|
Hi all,
Can I get a user's emailAddress from a ADS server in VC++? ( on win2k)
Thanks for any answer.
|
|
|
|
|
Hi,
I make some HTML parseing with MSHTML. The returned file paths are put into CString's. My problem is that they contain e.g.
%20
characters instead of space and also other strings with this format:
%number
With them in my file paths they are not valid paths.
Any ideas how to get rid of them?
Thanks
R.
|
|
|
|
|
|
Can someone help me out.. I am trying to get hToken so that I can call CreateProcessAsUser inorder to install software as the specified domain user with admin rights on the local box.. when I run this code in the debugger I always get a "LogonUser failed. Error = 522".. I am running this code on a windows 2k box, I havent tried a NT box Any ideas?
ULONG CInstAdminDlg::Impersonate()
{
ULONG iLastError = 0;
HANDLE hToken = 0;
char *szUserName = "rjones";
char *szDomain = "mydomain";
char *szPassword = "mypassword";
DWORD dwSize = 50+1;
char szUser[50+1]={0};
GetUserName(szUser, &dwSize);
OutputDebugString("*** Before ImpersonateLoggedOnUser: ");
OutputDebugString(szUser);
OutputDebugString("\n");
LUID Luid;
if(!LookupPrivilegeValue(NULL, SE_TCB_NAME, &Luid))
{
OutputDebugString("LookupPrivilegeValue failed.\n");
iLastError = GetLastError();
goto Exit;
}
HANDLE hProcToken;
if(!OpenProcessToken(GetCurrentProcess(),
TOKEN_ADJUST_PRIVILEGES|TOKEN_QUERY|TOKEN_DUPLICATE, &hProcToken))
{
OutputDebugString("OpenProcessToken failed.\n");
iLastError = GetLastError();
goto Exit;
}
TOKEN_PRIVILEGES TokenPriv;
TokenPriv.PrivilegeCount = 1;
TokenPriv.Privileges[0].Luid = Luid;
TokenPriv.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED ;
if(!AdjustTokenPrivileges(hProcToken, FALSE, &TokenPriv, 64, NULL, NULL))
{
OutputDebugString("AdjustTokenPrivileges failed\n");
iLastError = GetLastError();
goto Exit;
}
if (!LogonUser(szUserName, szDomain, szPassword, LOGON32_LOGON_INTERACTIVE,
LOGON32_PROVIDER_DEFAULT, &hToken))
{
OutputDebugString("LogonUser failed.\n");
iLastError = GetLastError();
goto Exit;
}
if (!CreateProcessAsUser(
hToken,
"C:\\CodeProjectSearchBar.exe",
NULL,
NULL,
NULL,
TRUE,
NULL,
NULL,
NULL,
NULL,
NULL
))
{
OutputDebugString("Process failed.\n");
iLastError = GetLastError();
goto Exit;
}
RegCloseKey(HKEY_CURRENT_USER);
Exit:
if (iLastError)
{
char szErr[64];
sprintf(szErr,"Error = %x\n",iLastError);
OutputDebugString(szErr);
}
return iLastError;
}
|
|
|
|
|
You are passing NULL for both the STARTUPINFO and PROCESS_INFORMATION parameters. This is not possible, you have to initialize a STARTUPINFO struct and pass it to CPAU and also to retrieve the process information via a PROCESS_INFORMATION struct.
--
Daniel Lohmann
http://www.losoft.de
(Hey, this page is worth looking! You can find some free and handy NT tools there )
|
|
|
|
|
Something has happend to my workspace, so each time when i change something in the resource menu's toolbar's or dlg's and rebuild an error says that it was unable to find a TLB file.
in the RC file - look's like this
1 TYPELIB "MCTRACK.tlb"<br />
#endif // not APSTUDIO_INVOKED
When the line is removed everythings oki until you change in the resources again.
This is very anoying... someone how know whats wrong... I have looked the workspace settings trough, but could not find anything..??
Hmm...
|
|
|
|
|
Most likely you have a line elsewhere in the .rc file that looks something like this:
"1 TYPELIB ""MCTRACK.TLB""\r\n"
If that is the case, you can comment out that line as well.
A much better proposition would be to modify the path so that it can find the file. It was put there for some reason, right?
John
|
|
|
|
|
You where rigth.. it helped a lot..thank's
And it came in there or put in there,when the project where, by mistake openede in VC7..
Hmm...
|
|
|
|
|
how can i get the width and the height of the jpeg file??
I found this article in microsoft.com. but i don't know and can't find what is CHECKJPEGFORMAT ???
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/gdi/bitmaps_6145.asp
<br />
<br />
<br />
ul = CHECKJPEGFORMAT;<br />
<br />
if (<br />
<br />
(ExtEscape(hdc, QUERYESCSUPPORT,<br />
sizeof(ul), &ul, 0, 0) > 0) &&<br />
<br />
<br />
(ExtEscape(hdc, CHECKJPEGFORMAT,<br />
pvJpgImage, nJpgImageSize, sizeof(ul), &ul) > 0) &&<br />
<br />
<br />
(ul == 1)<br />
)<br />
{<br />
<br />
memset(&bmi, 0, sizeof(bmi));<br />
bmi.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);<br />
bmi.bmiHeader.biWidth = ulJpgWidth;<br />
bmi.bmiHeader.biHeight = -ulJpgHeight;
bmi.bmiHeader.biPlanes = 1;<br />
bmi.bmiHeader.biBitCount = 0;<br />
bmi.bmiHeader.biCompression = BI_JPEG;<br />
bmi.bmiHeader.biSizeImage = nJpgImageSize;<br />
<br />
<br />
iRet = StretchDIBits(hdc,<br />
ulDstX, ulDstY, ulDstWidth, ulDstHeight,<br />
0, 0, ulJpgWidth, ulJpgHeight,<br />
pvJpgImage,<br />
&bmi,<br />
DIB_RGB_COLORS,<br />
SRCCOPY);<br />
<br />
if (iRet == GDI_ERROR)<br />
return FALSE;<br />
}<br />
else<br />
{<br />
}<br />
|
|
|
|
|
try any of the image classes on this site. finding dimensions of a JPG is not a trivial task, due to the way they're encoded.
-c
Though the cough, hough and hiccough so unsought would plough me through,
enough that I o'er life's dark lough my thorough course pursue.
--Stuart Kidd
|
|
|
|
|
try libjpeg, http://www.ijg.org/
|
|
|
|
|
I thought I had read something about a tri-state control but not sure if it was a button. I would like to have a push button that stays down when you click it until you click it again and then it would pop up. Of course, I would change the bitmap on the button so that the user would know what state it is in.
Anyone know if this is possible?
|
|
|
|
|
See this class/exaple here at codeproject.
Sonork 100.15206;PavelK
|
|
|
|
|
Ok. I'll look into it. Thanks.
|
|
|
|
|
I cant find this addressed anywhere. If I want to assign an incoming function parameter set1 to a member set m_set can I do :
m_set = set1
or do I have to iterate through them ? Thanks,
ns
|
|
|
|
|
I think this depends on whether the operator "=" is overloaded for your specific class. If so, no itemration is necessary.
|
|
|
|