|
Hello!
I have a little problem: I want to access an acount on the web(using IE), from my Visual C++(6) application, knowing the url, user-name & password.
For example:
url: http://mail.yahoo.com
user: dorutzu
pass: the_password
All I want to happen is a new browser window to appear with my account opened in it.
Any ideea how this can be made possible(for any web-site)?
Thank you in advance...I'm waiting for your answers here or eventualy at dorutzu@yahoo.com
|
|
|
|
|
Search MSDN for IE Automation.
|
|
|
|
|
Unfortunately, that did'n help too much...if you could be a little more specific... 10x
|
|
|
|
|
|
void CHtmlView::Navigate2( LPCTSTR lpszURL, DWORD dwFlags = 0, LPCTSTR lpszTargetFrameName = NULL, LPCTSTR lpszHeaders = NULL, LPVOID lpvPostData = NULL, DWORD dwPostDataLen = 0 );
I assume that the login page uses a , so you need to construct the post data parameter block and pass it as the lpvPostData param. As for opening in new window, see the lpszTargetFrameName param.
|
|
|
|
|
hello friends,
i have to incorporate communication in my vc++ application, for this i have to execute SCP script through VC++ code.Pls give me idea how to do it.
thanks
|
|
|
|
|
Service Control Point?
If this is just a file, will ShellExecute() or CreateProcess() work for you?
|
|
|
|
|
i tried to use following code to execute a .scp file :-
#include <afxwin.h>
#include <iostream.h>
void main()
{
STARTUPINFO si;
PROCESS_INFORMATION pi;
ZeroMemory(&si,sizeof(si));
si.cb = sizeof(si);
ZeroMemory(&pi,sizeof(pi));
//TCHAR szCommandLine[] = TEXT("Notepad");
//start the child process
if(!CreateProcess(NULL,"c:\\WINNT\\system32c\\ras\\testscp.scp",
NULL,
NULL,
FALSE,
0,
NULL,
NULL,
&si,
&pi)
)
{
cout << "creating process failed\n";
return;
}
CloseHandle(pi.hProcess);
CloseHandle(pi.hThread);
}
but it is not invoking the ,c:\\WINNT\\system32c\\ras\\testscp.scp ,file.Howere if i simply invoke "Notepad" or "windeff"instead of above file ,it worked.
Pls suggest me how to execute a .scp saved in a given folder.
regards
akshay
|
|
|
|
|
Can you run c:\WINNT\system32c\ras\testscp.scp from a command prompt or the Start/Run box? If not, you won't be able to run it from code either.
|
|
|
|
|
hi,
i am able to invoke c:\winnt\system32\ras\testscp.scp through start|run but it is not working in CreateProcess(NULL,"c:\\winnt\\system32\\ras\\testscp.scp",............)
|
|
|
|
|
Then you will also need to supply the name of the application that is associated with .SCP files. This can be done in either the first or second parameter.
|
|
|
|
|
|
hello
i use the class CWinApp and the run methode to start my apllication ,and i want to add a button for suspend and re-run the apllication.
how i can make that?
|
|
|
|
|
Hi!
Is there perhaps a header file that I could use that would allow me to use very long numbers in my calculations? Something that could take up to 20 digits would be nice, though more would be appreaciated.
Thanks,
Selevercin
If you have a problem with my spelling, just remember that's not my fault. I (as well as everyone else who learned to spell after 1976) blame it on Robert A. Kolpek for U.S. Patent 4,136,395.
|
|
|
|
|
|
There are some arbitrary precision numeric libraries on the net. Check for instance GMP[^].
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Hi,
You can use Decimal data type and Decimal arithmetic functions: VarDecAdd, VarDecMul etc. They are declared in oleauto.h. Decimal variables are stored as 12-byte signed integers and can store values from 0.0000000000000000000000000001 to 79,228,162,514,264,337,593,543,950,335
Alexander
|
|
|
|
|
for floating point, look up long double in the doc. Range is +/–1.2E4932 with at least 19 digits of precision.
|
|
|
|
|
long double is there for backward compatibility only - it's now the same as double (15 digits of precision).
Anna
Homepage | My life in tears
"Be yourself - not what others think you should be"
- Marcia Graesch
"Anna's just a sexy-looking lesbian tart"
- A friend, trying to wind me up. It didn't work.
Trouble with resource IDs? Try the Resource ID Organiser Visual C++ Add-In
|
|
|
|
|
Hi,
I faced really weird situation.
I wrote a code that opens some target file with Shellexecute() like following line.
ShellExecute(NULL, "open", szTargetName, NULL, NULL, SW_SHOWNORMAL);
This is written in independent cpp file which is included in some project.
I compiled it, and it was working in WIN 2K.
However, When I try to close MS WORD(***.doc) file which is opened by this project, windows freezes.
After long time, there was a pop up message that indicates "this process takes long time, do you want to continue?"
Everything is fine except MS WORD on WIN98.
I really wanna know what's going on and how to solve this problem.
PLEASE HELP ME.
Thanks in advance.
|
|
|
|
|
I've had this problem too - try putting in a wait for a few seconds after the open, and see what happens.
|
|
|
|
|
Hello.
I'm writing a forms processing app, using MFC, which reads form data
from an XML file. By form data I mean - what the form is supposed to look like, coordinates
of where each form element is located, type of form element (button, textfield, table, etc.)
So far I had no problems creating controls on a CDialog - I just used CreateWindow with preset classnames (COMBOBOX, EDIT, etc). However there are two elements I'm not quite sure how to display:
One is a Table, for which I thought I'd use MSFlexGrid and another - DataControl, for which I was going to use the Microsoft ADO Data Control.
The thing is I cannot find any docs on how to display those without making use of dialog templates.
Could anyone help me out?
Thank you.
Marat Garafutdinov.
|
|
|
|
|
MSHFlexGrid has a create function:
virtual BOOL Create(LPCTSTR lpszClassName,
LPCTSTR lpszWindowName, DWORD dwStyle,
const RECT& rect,
CWnd* pParentWnd, UINT nID,
CCreateContext* pContext = NULL)
Try using this function, and I think that the Class Name is not that important because I don't see it being used in the function's body.
// Afterall I realized that even my comment lines have bugs
|
|
|
|
|
I am having problem with accessing a particular location of bitmap.
what i want to do is store the x,y coordinates of black pixels on a perfectly white background. The error code is "GetPixel' : cannot convert parameter 1 from 'struct HDIB__ ** ' to 'struct HDC__ *'"
I tried GetPixel (x,y) but it doent work neither.
Does anyone know?Thanks!
POINT* p=new POINT[length];
POINT* p2=new POINT[length];
int w=cxDIB;//the width of the image
int h=cyDIB;//the height of the bitmap
i=0;
for(w=0;w<=cxDIB;w++)
{
for(h=0;h<=cyDIB;h++)
{
p[i].x=w;
p[i].y=h;
i++;
}}
i=0;
for(w=0;w<=cxDIB;w++)
{
for(h=0;h<=cyDIB;h++)
{
if(GetPixel(m_hDIB2,p->x,p->y)==RGB(0,0,0)) p2[i] =p[i];
i++;
}}
delete [] p;
delete [] buf;
|
|
|
|
|
A DIB is not a device context the following code will hopefully start you on your way. It does not handle all DIB formats especially it does not handle RLL compressed DIBs. You need to consider the DIBInfo which will specify page vs interleaved pixels, number of color planes and bits per pixel. Also each scanline will be padded to 4 byte ie DWORD boundaries.
As you can see it was written a long time ago in Win32 but i doubt the basic structures have changed.
Depending on your requirements it might be easier to render the DIB into a CMemDC and retrieve the pixels from there ?
/*************************************************************************
*
* getDIBPixel(hDIB, x , y)
*
* Parameter:
*
* HDIB hDIB - handle to global memory with a DIB spec
* in it followed by the DIB bits
*
* Return Value:
*
* DWORD - index to color of pixel or RGB for 24 bit or
* RGBX for 32 bit per pixel bitmaps
*
* Description:
*
* This function finds the color of a DIB pixel
*
************************************************************************/
DWORD WINAPI getDIBPixel(HDIB hDIB, int x, int y)
{
DWORD dwColor;
WORD wBitCount;
DWORD dwWidth, dwHeight, dwX, dwY;
DWORD scanline_bytes;
LPSTR lpDIB; // pointer to packed-DIB
LPSTR lpDIBBits; // Pointer to DIB bits
LPBITMAPINFO lpbmi; // pointer to BITMAPINFO structure (Win3.0)
LPBITMAPCOREINFO lpbmc; // pointer to BITMAPCOREINFO structure (old)
lpDIB = (LPSTR) ::GlobalLock((HGLOBAL) hDIB);
lpDIBBits = ::FindDIBBits(lpDIB);
// get pointer to BITMAPINFO (Win 3.0)
lpbmi = (LPBITMAPINFO)lpDIB;
// get pointer to BITMAPCOREINFO (old 1.x)
lpbmc = (LPBITMAPCOREINFO)lpDIB;
// the number of bits per pixel for the DIB
if (IS_WIN30_DIB(lpDIB))
wBitCount = ((LPBITMAPINFOHEADER)lpDIB)->biBitCount;
else
wBitCount = ((LPBITMAPCOREHEADER)lpDIB)->bcBitCount;
// end of number of bits per pixel
dwWidth = ::DIBWidth(lpDIB);
dwHeight = ::DIBHeight(lpDIB);
dwX = (DWORD) x;
dwY = dwHeight - (DWORD) (y + 1);
// TRACE2("getDIBPixel dwX=%ld, dwY=%ld\n", dwX, dwY);
// WIDTHBYTES performs DWORD-aligning of DIB scanlines. The "bits"
// parameter is the bit count for the scanline (biWidth * biBitCount),
// and this macro returns the number of DWORD-aligned bytes needed
// to hold those bits.
scanline_bytes = (((dwWidth * (DWORD) wBitCount) + 31) / 32 * 4);
DWORD dwXoffset, dwYoffset, dwXBitoffset;
DWORD pixel_addr;
BYTE pixel_data;
dwXoffset = ((dwX * (DWORD) wBitCount) / 8);
dwXBitoffset = (dwX * (DWORD) wBitCount) - (dwXoffset * 8);
dwYoffset = (dwY * scanline_bytes);
// TRACE3("getDIBPixel dwXoffset=%ld dwXBitoffset=%ld dwYoffset=%ld\n",dwXoffset, dwXBitoffset, dwYoffset);
pixel_addr = dwYoffset;
pixel_addr += dwXoffset;
pixel_data = *( (BYTE huge *)lpDIBBits + pixel_addr );
// TRACE1("getDIBPixel pixel_data=0x%x\n", pixel_data);
//extract relevant bits
switch (wBitCount) {
case 1:
break;
case 2:
break;
case 4:
switch(dwXBitoffset) {
case 0:
pixel_data = pixel_data>>4;
pixel_data = pixel_data & 0x0F;
break;
case 4:
pixel_data = pixel_data & 0x0F;
break;
}
dwColor = (DWORD) pixel_data;
break;
case 8:
dwColor = (DWORD) pixel_data;
break;
case 24:
// TRACE1("Blue = 0x%x",pixel_data);
dwColor = (DWORD) pixel_data;
pixel_data = *( (BYTE huge *)lpDIBBits + pixel_addr + 1 );
// TRACE1("Green = 0x%x",pixel_data);
dwColor += (DWORD) pixel_data * 256;
pixel_data = *( (BYTE huge *)lpDIBBits + pixel_addr + 2);
// TRACE1("Red = 0x%x\n",pixel_data);
dwColor += (DWORD) pixel_data * 65536;
break;
}
::GlobalUnlock((HGLOBAL) hDIB);
// TRACE1("getDIBPixel dwColor=0x%lx\n", dwColor);
return(dwColor);
}
|
|
|
|
|