|
Paul Selormey wrote:
Use that in the normal CWnd derived class that the wizard will generate for you to hack it!
My problem is that when I try to have Class wizard generate something it reports the error I mentioned in my first post.
|
|
|
|
|
Raggamuffin wrote:
My problem is that when I try to have Class wizard generate something it reports the error I mentioned in my first post.
I know. This is because the pdf.ocx is only an automation interface OCX for the real pdf ActiveX control.
Use the Class Wizard and select the pdf.tlb, it will generate the Automation interface and empty event interface for you, say CPdf.
You may search your system to find the real ActiveX or use the ClassWizard to generate a wrapper for any simple ActiveX control, then delete everything with the exception of the Create and GetClsid methods.
Replace the GetClsid method with the one I have provided in my earlier reply. Create the window, use GetControlUnknown method to retrieve IUnknown interface, and the IDispatch interface from the IUnknown. Pass the IDispatch interface to the CPdf instance, and use the CPdf instance to control it. It has LoadFile, which you can use to open a file etc.
If it is getting confusing, write to me privately, I will try to help. If interested, I could write an article with sample for CodeProject
Best regards,
Paul.
Jesus Christ is LOVE! Please tell somebody.
|
|
|
|
|
Hi.
I am trying to upload a variable and file thru POST thru HTTP. The script is not getting both. IE works fine and I tried to use same headers as of IE> but still it doesnt work.
I also tried to send one variable thru multipart/form-data. but its not working.
Here is the code for sending one variable.
CInternetSession session;<br />
CHttpConnection *http=session.GetHttpConnection("192.168.0.2");<br />
CHttpFile *pFile=http->OpenRequest(CHttpConnection::HTTP_VERB_POST,"/bluestar/post1.php",NULL,NULL,NULL,"HTTP /1.0",INTERNET_FLAG_RELOAD);<br />
<br />
CString sContent;<br />
sContent= CString(HTML_BOUNDARY)+"\r\nContent-Disposition: form-data; name=\"packet\"\r\r";<br />
sContent+="Faizan";<br />
CString sEnding="\r"+CString(HTML_BOUNDARY)+"\r";<br />
<br />
<br />
sContent+=sEnding;<br />
CString sPacket;<br />
CString str; <br />
sPacket="Accept: */*\rAccept-Language: en\r";<br />
sPacket+="Content-Type: multipart/form-data; boundary=" + CString(HTML_BOUNDARY)+"\r";<br />
sPacket+="Connection: Keep-Alive\r";<br />
str.Format("Content-Length: %d\r",sContent.GetLength());<br />
sPacket+=str; <br />
<br />
pFile->SendRequest(sPacket,(LPVOID)(LPCTSTR)sContent,sContent.GetLength());<br />
char szData[200];<br />
int iRead=0;<br />
while((iRead=pFile->Read(szData,200))>0)<br />
{<br />
szData[iRead]=NULL;<br />
TRACE("Read back is %s\n",szData);<br />
m_eRec+=szData;<br />
<br />
} <br />
UpdateData(FALSE);<br />
<br />
pFile->Close();<br />
http->Close();
Has anybody done this before using multipart/form-data.
|
|
|
|
|
Try this code:
CInternetSession session;<br />
CHttpConnection *http=session.GetHttpConnection("127.0.0.1");<br />
CHttpFile *pFile=http->OpenRequest(CHttpConnection::HTTP_VERB_POST,"/scripts/uploadf.cgi",NULL,NULL,NULL,"HTTP /1.0",INTERNET_FLAG_RELOAD);<br />
CString sContent;<br />
sContent= CString("--7d3335262f08b6")+"\r\nContent-Disposition: form-data; name=\"uploadfile\" filename=\"c:\\dccard.xml\"\r\n\r\n";<br />
sContent+=szXMLDocument;<br />
CString sEnding="\r\n"+CString("--7d3335262f08b6--")+"\r\n";<br />
sContent+=sEnding;<br />
CString sPacket;<br />
CString str_data; <br />
sPacket="Accept: */*\rAccept-Language: en\r\n";<br />
sPacket+="Content-Type: multipart/form-data; boundary=" + CString("7d3335262f08b6")+"\r\n";<br />
sPacket+="Connection: Keep-Alive\r\n";<br />
str_data.Format("Content-Length: %d\r\n\r\n",sContent.GetLength());<br />
sPacket+=str_data; <br />
pFile->SendRequest(sPacket,(LPVOID)(LPCTSTR)sContent,sContent.GetLength());<br />
pFile->Close();<br />
http->Close();
|
|
|
|
|
|
can somebody tell me how too trace that and user logon in or not?
use com, api or...
|
|
|
|
|
Here it is...
<br />
#define STATUS_SUCCESS ((NTSTATUS)0x00000000L)<br />
#define UNICODE<br />
<br />
VOID GetSessionData (PLUID session)<br />
{<br />
PSECURITY_LOGON_SESSION_DATA sessionData = NULL;<br />
NTSTATUS retval;<br />
WCHAR buffer[256];<br />
WCHAR *usBuffer;<br />
int usLength;<br />
<br />
if (!session ) {<br />
wprintf(L"Error - Invalid logon session identifier.\n");<br />
return;<br />
}<br />
retval = LsaGetLogonSessionData (session, &sessionData);<br />
if (retval != STATUS_SUCCESS) {<br />
wprintf (L"LsaGetLogonSessionData failed %lu \n",<br />
LsaNtStatusToWinError(retval));<br />
if (sessionData) {<br />
LsaFreeReturnBuffer(sessionData);<br />
}<br />
return;<br />
} <br />
if (!sessionData) {
wprintf(L"Invalid logon session data. \n");<br />
LsaFreeReturnBuffer(sessionData);<br />
return;<br />
}<br />
if (sessionData->UserName.Buffer != NULL) {<br />
usBuffer = (sessionData->UserName).Buffer;<br />
usLength = (sessionData->UserName).Length;<br />
lstrcpyn (buffer, usBuffer, usLength);<br />
lstrcat (buffer,L"");<br />
wprintf (L"user %s was authenticated ",buffer);<br />
} else {<br />
wprintf (L"\nMissing user name.\n");<br />
LsaFreeReturnBuffer(sessionData);<br />
return;<br />
}<br />
if ((SECURITY_LOGON_TYPE) sessionData->LogonType == Interactive) {<br />
wprintf(L"interactively ");<br />
}<br />
if (sessionData->AuthenticationPackage.Buffer != NULL) {<br />
usBuffer = (sessionData->AuthenticationPackage).Buffer;<br />
usLength = (sessionData->AuthenticationPackage).Length;<br />
lstrcpyn (buffer, usBuffer, usLength);<br />
lstrcat (buffer,L"");<br />
wprintf(L"using %s ",buffer);<br />
} else {<br />
wprintf (L"\nMissing authentication package.");<br />
LsaFreeReturnBuffer(sessionData);<br />
return;<br />
}<br />
if (sessionData->LogonDomain.Buffer != NULL) {<br />
usBuffer = (sessionData->LogonDomain).Buffer;<br />
usLength = (sessionData->LogonDomain).Length;<br />
lstrcpyn (buffer, usBuffer, usLength);<br />
lstrcat (buffer,L"");<br />
wprintf(L"in the %s domain.\n",buffer);<br />
} else {<br />
wprintf (L"\nMissing authenticating domain information. ");<br />
LsaFreeReturnBuffer(sessionData);<br />
return;<br />
}<br />
LsaFreeReturnBuffer(sessionData);<br />
return;<br />
}<br />
BuggyMax
|
|
|
|
|
Where to Find Good MFC FAQ?
|
|
|
|
|
Have you tried typing "MFC FAQ" at Google and seeing what turns up?
Kevin
|
|
|
|
|
everbody like google! so good!
'|'
|
|
|
|
|
Here are a few to get you started:
http://www.flounder.com/mvp_tips.htm
http://cui.unige.ch/OSG/people/Past/fuentes/Mfc/mfc.html
http://www.mooremvp.freeserve.co.uk/
http://www.naughter.com/
Googling for more will be a good exercise.
|
|
|
|
|
|
hi all
I've a bitmap as background in dialog based application.
Is it possible to make some change in a small rect part of this bitmap?
not in whole bitmap.Like making that small part transprint or anyother
......effect?
|
|
|
|
|
i forgot to tell, bitmap is not resource. I'm loading it
|
|
|
|
|
hey,
does anyone know how to insert text into an avi file?
there's a filter that does this, aware motion ... something,
but i wanted to know how to do something like that,
any help would be very ... um, ... helpfull !
thanks
|
|
|
|
|
Hi !
I'd like to put a bmp on a button. It is an arrow, so I've drawn this arrow in the ressource editor, using grey for the background, and blue for my arrow.
The problem is, when the user does not use the default Windows theme (with gry windows ...9 or under XP theme), the background of my bitmap stays grey, whereas the rest of the windows has another color. How can I do to have the background color of my bmp be read as "transparent" ? Do i have to manually blit the bitmap everytime the window is being redrawn ??? (I hope not...)
Thanls for the help...
~RaGE();
|
|
|
|
|
Why u don't make the background transparent? I thinks its the green monitor button in the icon editor.
Thanks, Mark
|
|
|
|
|
macmac38 wrote:
Why u don't make the background transparent
Because I have used a bitmap, and not an icon. Let's use an icon
Thanks for the help.
~RaGE();
|
|
|
|
|
button->properties->styles.bitmap(click)
button->properties->extended styles.transparent(click)
i hope it will work
|
|
|
|
|
no no... i'm not right..
you can make your background transparent in the icon editor...
click the oranje/rose monitor.
sorry
|
|
|
|
|
See if this article is of any help.
http://flounder.com/bitmapbutton.htm
|
|
|
|
|
Hello,
when i like to overwrite data in a file with new data, how i do it?
I have a file where i save the filenames entered in the "save as" dialog window.
Thanks, Mark
|
|
|
|
|
Hi,
use "CFile::modeCreate" mode.
It will truncate the file to 0, if the file is already exists(overwrite). Otherwise, it will create a new file.
Hope this helps
regards
~Hari~
|
|
|
|
|
Thanks! I haven't found a good howto about CFile in the web yet. Always the same stuff like in the VC help..
regards Mark
|
|
|
|
|
I'm trying to load a bitmap into a imagelist, and to get a transparent background.
The imagelist is used in a CListCtrl.
When I load the bitmap directly I get transparent images, but wrong colors.
m_ilReport.Create(IDB_TOOLBAR_GRID256, 16, 1, RGB(255,0,255));
If I load it into a CBitmap first the colors look ok, the problem is that the mask color is replaced with black. SetBkColor seems to have no affect. I've tried with regular colors too.
m_ilReport.Create(16, 16, ILC_COLOR8, 16, 1);
CBitmap bmp;
bmp.LoadBitmap(IDB_TOOLBAR_GRID256);
m_ilReport.Add(&bmp, RGB(255, 0, 255));
m_ilReport.SetBkColor(CLR_NONE);
ctl.SetImageList(&m_ilReport);
What have I done wrong?
|
|
|
|