|
thank you.
But can you give me a demo code?or where can download such demo?
thank you again.
|
|
|
|
|
|
can you tell me what's the difference of HCBT_CREATEWND and HSHELL_WINDOWCREATED?
|
|
|
|
|
HI!
Well according to MSDN (If its wrong it's Microsoft to blame )
HSHELL_WINDOWCREATED will be called when "A top-level, unowned window has been created. The window exists when the system calls a ShellProc function."
and
HCBT_CREATEWND will be called when "A window is about to be created. The system calls the hook procedure before sending the WM_CREATE or WM_NCCREATE message to the window. If the hook procedure returns a nonzero value, the system destroys the window; the CreateWindow function returns NULL, but the WM_DESTROY message is not sent to the window. If the hook procedure returns zero, the window is created normally."
Regards,
Bilal Anjum
|
|
|
|
|
|
Hey all.
I've got a tiny helper application that I've built that creates text files on a network/shared drive.
I'm presently just using CStdioFile to create the text files.
The problem that I am running into is username/password authentication. I don't really know where to start for this and would appreciate some pointers in the right direction. The network/shared drive is "\\S-CPU1\c\the_folder". If I open up IE, and go to \\S-CPU1\c\the_folder ... the first time I try it, IE asks for the username/password. I enter it in, it goes there. I can then close out of IE and it "remembers" the username/password combination (or keeps me logged in to it, or whatever) until I physically LOG OUT or switch users. So, if I do that one time, I can then run my helper app, and it creates the files over on that shared folder without a problem.
The problem is I would like to automate this, so that I/the user does not have to first bring up IE and go through that process (and I don't want to physically MAP a drive to that folder). I would like to be able to run my app, and if it realizes that it needs a user/password to access that folder, it will go ahead and bring up a prompt asking the user for that information. After that point, it'll just roll through and do it's thing.
I've searched for several phrases in the articles on this site, but can not seem to find anything that is doing what I want. If someone could point me in the right direction, I would greatly appreciate it.
Shultas
|
|
|
|
|
DWORD WNetAddConnection2(
LPNETRESOURCE lpNetResource, // connection details
LPCTSTR lpPassword, // password
LPCTSTR lpUsername, // user name
DWORD dwFlags // connection options
);
lpLocalName :Points to a null-terminated string that specifies the name of a local device to redirect, such as "F:" or "LPT1". The string is treated in a case-insensitive manner.
If the string is empty, or if lpLocalName is NULL, the function makes a connection to the network resource without redirecting a local device.
|
|
|
|
|
how do i change a program which wae built to compile with nmake to compile
with the c++ build tool.
please help
|
|
|
|
|
You should be able to open the .mak file with Visual Studio.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
Here is my scenario
My Main Dialog creates a propertyPage , and resizes it to fit the bounds of the Main Dialog window .
mainSheet= new CPropertySheet();<br />
mainSheet->AddPage(&page1);<br />
int res=mainSheet->Create(this, WS_POPUP| WS_BORDER |WS_VISIBLE ,0 );<br />
if(!res){<br />
AfxMessageBox("Could not Create PropertySheet",MB_ICONERROR);<br />
return ;<br />
}<br />
mainSheet->AddPage(&page2);<br />
CRect r;<br />
this->GetWindowRect(&r);<br />
mainSheet->SetWindowPos(0,r.left+10,r.top+60,r.Width()-20,r.Height()-130,0);
To the PropertyPage I add 2 propertypages .
What is happenning right now is that the PropertySheet occupies the desired region of the main window , but the inner PropertyPages are displayed in their original size !
How do I make the PropertyPage resize to the current revised size of the its parent i.e the PropertyPage ?
|
|
|
|
|
|
Is there a way to save the web page contents to an image. Just the contents, no toolbar, no status bar. In other words print web page to image file??
Thanks a lot.
|
|
|
|
|
Hi all,
How can I program to pop up a WordPad window for showing some formatted text for help purpose
in visual c++ 6 ?
Thanks
|
|
|
|
|
ShellExecute or CreateProcess.
onwards and upwards...
|
|
|
|
|
Thanks for your reply.
If I use createProcess() to launch the MS WordPad, how
can I avoid the problem that there may be differences in the path name of the application in different windows platform ?
Or is there any MFC class that i could use to launch a RTF document ?
Thanks
|
|
|
|
|
That's why the recommended way to display a document is to use ShellExecute. ShellExecute will open whatever program is associated with the file extension.
onwards and upwards...
|
|
|
|
|
Hi everybody
I have written an ATL 3.0 project including two sample classes named CAttachment & CAttachments. These classes have interfaces IAttachment & IAttachments in order. IAttachments has got a method named "Item" that returns a result of the type of IAttachment. But before returning the IAttachment, I want to call some member functions of the CAttachment class to setup the IAttachment properly. I know how to create the IAttachment interface, but I don't know how to have access to the members of the CAttachment from the Item method. I will be thankful if anybody replies to me.
Regards,
Roozbeh.
|
|
|
|
|
It's a hack but you could cast your IAttachment interface to CAttachment and call the methods you desire.
CAttachment a = (CAttachment)piAttachment;
a->SomeMethodNotExposedInIAttachment();
pi->SomeMethodExposedByIAttachment();
Note, this won't work outside your implementation project as outside callers won't have access to the CAttachment class or any of its members not exposed by the IAttachment interface.
|
|
|
|
|
How is the CAttachments object producing the interface IAttachment to return?
Presumably you must be making a CAttachment object somewhere, or do you have them already created and you're just holding a list of the IAttachment interfaces?
Steve S
|
|
|
|
|
Ok, sorry for the simple subject and for possibly this simple question, but here is what I want to do:
How do I compile in VC++ 6.0 using the .NET\Vc7\INCLUDE versions of
\Microsoft Visual Studio\VC98\INCLUDE\xlocale
\Microsoft Visual Studio\VC98\INCLUDE\xlocnum
\Microsoft Visual Studio\VC98\INCLUDE\streambuf
\Microsoft Visual Studio\VC98\INCLUDE\xmemory
(how?)
I want to use the same files, except they are from:
\Microsoft Visual Studio .NET\Vc7\include
I also want to do this in only one project of a multiple project VC++ 6.0 workspace.
Thank you for the help.
Johnny
|
|
|
|
|
Just havethe desired path .NET\Vc7\INCLUDE appear before the \Microsoft Visual Studio .NET\Vc7\include in your project "include" directory settings. There's "move up/down functionality in the prop page.
|
|
|
|
|
I am compiling in VC++ 6.0, but want to use
C:\Program Files\Microsoft Visual Studio .NET\Vc7\include\xlocale
C:\Program Files\Microsoft Visual Studio .NET\Vc7\include\xlocnum
C:\Program Files\Microsoft Visual Studio .NET\Vc7\include\streambuf
C:\Program Files\Microsoft Visual Studio .NET\Vc7\include\xmemory
When I compile in 6.0, the inclusion of
C:\Program Files\Microsoft Visual Studio .NET\Vc7\include
has no effect.
When I use the Studio IDE or look directly at the .DSP file, i don't see anywere that I can place the Studio.NET-Vc7 version AHEAD OF the 6.0-VC98 version of these files.
Any suggestion?
Thanks.
Johnny
|
|
|
|
|
Do this Tools | Options. Find Projects | VC++ Directories. Change the order of the Include Files (select from the combobox at the upper right). Just move the desired directories to the top, even add new ones if you wish
|
|
|
|
|
Hi all,
I am currently doing a project where I need to be able to have a imaging framework.
Although the framework itself runs pretty smooth, the CPaintDC of MFC kills me.
The SetPixelV is extremely slow, so I want to use another way of doing this.
I know it is possible to create a CDC in memory, but how can I put a bitmap created from this CDC put on the surface a CWnd subclassed control?
Any suggestions?
LPCTSTR Dutch = TEXT("Double Dutch ");
|
|
|
|
|
 bitblt.
Code snippet to help you (heavily edited and content deleted):
BOOL DoChart(CallContextObj *pCallContextObj)
{
CDC oMemDC;
CBitmap *pOldBmp;
CBitmap oBmp;
long lWidth = 300;
long lHeight = 200;
pCallContextObj->GetParameterValue("ChartWidth",&lWidth);
pCallContextObj->GetParameterValue("ChartHeight",&lHeight);
CRect oBmpSize(0,0,lWidth,lHeight);
oMemDC.CreateCompatibleDC(NULL);
int iOldMapMode = oMemDC.SetMapMode(MM_TEXT);
CWindowDC dcScreen(NULL);
oBmp.CreateCompatibleBitmap(&dcScreen,oBmpSize.Width(), oBmpSize.Height());
pOldBmp = oMemDC.SelectObject(&oBmp);
WORD wChartType = 88;
pCallContextObj->GetParameterValue("ChartType",&wChartType);
BOOL bRetval = FALSE;
char caHeaders[512];
strcpy(caHeaders,"Invalid Chart Type");
switch (wChartType)
{
case 0:
bRetval = DoLineChart(pCallContextObj,&oMemDC,caHeaders,oBmpSize);
break;
case 1:
bRetval = DoBarChart(FALSE,pCallContextObj,&oMemDC,caHeaders,oBmpSize);
break;
case 2:
bRetval = DoBarChart(TRUE,pCallContextObj,&oMemDC,caHeaders,oBmpSize);
break;
case 3:
bRetval = DoOpenHiLowCloseChart(pCallContextObj,&oMemDC,caHeaders,oBmpSize);
break;
case 4:
bRetval = DoPieChart(pCallContextObj,&oMemDC,caHeaders,oBmpSize);
break;
}
if (bRetval)
{
LPSTR cpBuf = pCallContextObj->GetOutputBufferPtr();
long lQuality = 75;
pCallContextObj->GetParameterValue("ImageQuality",&lQuality);
char caContentType[256];
long lDataSize = WriteImage(oBmp,cpBuf,pCallContextObj->GetOutputBufferSize(),caHeaders,(DWORD)lQuality);
if (lDataSize > 0)
{
pCallContextObj->SuppressHeaders();
pCallContextObj->GetMimeType("x.jpg",caContentType);
sprintf(caHeaders,"Content-Type: %s%sContent-Length: %d%s%s",caContentType,cpCRLF,lDataSize,cpCRLF,cpCRLF);
if (pCallContextObj->ServerSupportFunction(HSE_REQ_SEND_RESPONSE_HEADER,"200 OK",0,(LPDWORD)caHeaders) || ::GetLastError() == 10054)
pCallContextObj->WriteClient((LPVOID)cpBuf,(LPDWORD)&lDataSize);
*cpBuf = 0;
}
else
bRetval = FALSE;
}
oMemDC.SetMapMode(iOldMapMode);
oMemDC.SelectObject(pOldBmp);
oMemDC.DeleteDC();
onwards and upwards...
|
|
|
|
|