|
_Russell_ wrote: CString ResourceString="Select file(s)";
TCHAR szFile[IMPORT_MAX_PATH_LENGTH];
_tcscpy(szFile, ResourceString);
you could have factorized this anyway :
TCHAR szFile[IMPORT_MAX_PATH_LENGTH] = _T("Select file(s)");
|
|
|
|
|
|
|
I am trying to get OLE drag and drop to work in one of my applications. According to all the documentation I can find the minimum I need to be able to drag an object from my app into a OLE drag target would be:
<br />
HGLOBAL hData = GlobalAlloc(GMEM_MOVEABLE,20);<br />
if (hData != NULL)<br />
{<br />
char *pChar = (char *)GlobalLock(hData);<br />
strcpy(pChar,"This is a test");<br />
GlobalUnlock(hData);<br />
COleDataSource source;<br />
<br />
source.CacheGlobalData(<br />
CF_TEXT,<br />
hData);<br />
DROPEFFECT de = source.DoDragDrop(DROPEFFECT_COPY | DROPEFFECT_MOVE);<br />
}<br />
Which should allow me to drag text from my window to an ole enabled drop target. The above code is called in my OnLButtonDown handler. Everything seems to be ok until the COleDataSource::DoDragDrop function calls ::DoDragDrop() (OleDrop1.cpp line 181), which should return when the operation completes. But it returns immediately with DROPEFFECT_NONE which should not be the case. The way COleDataSource::DoDragDrop is written wont let me examine the return code for the function so I can see why its failing.
Has anyone got any ideas as to what the cause of the problem could be? My heads getting sore banging against a wall here
If you vote me down, my score will only get lower
|
|
|
|
|
No worries, finally tracked down the problem.
Its seems you need to call:
<br />
AfxOleInit();<br />
When your appp starts up to enable OLE. Not once in the standard docs for this is this mentioned anywhere. Grrrrr!
If you vote me down, my score will only get lower
|
|
|
|
|
Hi,
I'm working in VC++6 and using ODBC connection.
I'm debugging my code from my system. The exe and related dlls are in a different system. Suppose in the code i've 2 places where db functions are called(which in turn call Requery()/ Open()).
Just before i reach the first db function call, i remove the network connection and restore it (by unplugging and plugging the n/w cable).
When it reaches the 1st db call, it is giving me unhandled exception instead of going to DBException catch block.
In the override Open()function of CRecordset, I tried to re-establish the dbconnection if it is not there. Now if i remove n/w and restore it, it moves smoothly in the first call to db function. But in the 2nd call, i'm getting unhandled exception, and the database pointer itself is NULL now.
Why is this happening?
If the source code, exe and the dlls are in the same system, it goes to the DBException catch block without any change to restablish the db connection.
Thanks,
Sanju
-- modified at 6:42 Wednesday 22nd August, 2007
|
|
|
|
|
Hi all,
I've an ActiveX control with me and i want to aggregate this ActiveX control from a component.How can i do this? Anyone please help me
Thanks in advance
ss
|
|
|
|
|
hey Friends..
CDC::Arc(...) is not supported in eVC++ (WinCE).
Please give me some hint to draw Arc and Pie without using MFC methods
thanks ...
|
|
|
|
|
look at Win32 Api Arc and ArcTo
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief
|
|
|
|
|
Win32 Api Arc and ArcTo ...etc are not supported in eVC++(WinCE)
|
|
|
|
|
Win32 Api arenot supported in WinCE!!
|
|
|
|
|
Mmmm,
Have you looked into the API how does the function works? Maybe is it possible to code it separatelly.
I guess it is possible to program it giving the two points, a radio and a bool.
With the two points you limit the circle being drawn,
with the radio you take how flat or round should it be, a line is an arc of a circle with infinite radio.
with the bool you say: the shortest way between the points or the other side of the circle?
The equation of a circle is: x² + y² = r²
I hope it helps.
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
|
|
|
|
|
I answered the same question a few days ago. Different poster, same class?
And on examination, you're the same person who asked it!
Forget MFC - the CDC functions are only thin wrappers around the original Win32 GDI function calls.
Does ::Ellipse not work? Could you not find the documentation for ::SelectClipRgn, or ::CreatePolygonRgn? Or do they not work in WinCE?
If you don't want windows to do the heavy lifting for you, then you're going to have to roll your sleeves up and learn a bit more about sin & cos...
Iain.
|
|
|
|
|
Hello friends,
In my one of the project i require to send the data to the function resides on internet. Can i use the Socket on Port 80 ( which is reserved for HTTP)
or is there another way
|
|
|
|
|
Gaurang Shah 033 wrote: In my one of the project i require to send the data to the function resides on internet. Can i use the Socket on Port 80 ( which is reserved for HTTP)
or is there another way
is HTTP* or Internet* api of any use
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief
|
|
|
|
|
I'm using WinInet to call a Perl script on a webserver but at the moment I do it synchronously. Sometimes this gives real problems as it can take a few seconds for the InternetOpenUrl command to execute. I really want to do this asynchronously but I'm having a lot of trouble understanding how to do this. I don't need to read anything back from the webserver so I'm hoping there's a simple solution to this.
Can anyone help?
Sean O'Connor
http://www.windowsgames.co.uk
|
|
|
|
|
I think I've got it to work using this code but I'd be very grateful if anybody who knows their WinInet could take a look and let me know if I'm doing anything wrong (eg not freeing up things when I should be):
HINTERNET hInternetSession;
HINTERNET hURL;
typedef struct
{
HWND hWindow;
int nStatusList;
HINTERNET hResource;
char szMemo[512];
} REQUEST_CONTEXT;
REQUEST_CONTEXT request_context;
void __stdcall InternetCallbackFunction(HINTERNET hInternet,
DWORD dwContext,
DWORD dwInternetStatus,
LPVOID lpvStatusInformation,
DWORD dwStatusInformationLength)
{
REQUEST_CONTEXT *cpContext;
cpContext= (REQUEST_CONTEXT*)dwContext;
switch (dwInternetStatus)
{
case INTERNET_STATUS_HANDLE_CREATED:
hURL = hInternet;
break;
case INTERNET_STATUS_REQUEST_COMPLETE:
InternetCloseHandle(hURL);
InternetSetStatusCallback(hInternetSession, NULL);
InternetCloseHandle(hInternetSession);
break;
}
}
BOOL SendURL(char* szURL)
{
hInternetSession = InternetOpen("Microsoft Internet Explorer", INTERNET_OPEN_TYPE_PRECONFIG, NULL, NULL, INTERNET_FLAG_ASYNC);
if (hInternetSession != NULL)
{
InternetSetStatusCallback(hInternetSession, (INTERNET_STATUS_CALLBACK)InternetCallbackFunction);
hURL = InternetOpenUrl(hInternetSession, szURL, NULL, 0, INTERNET_FLAG_RELOAD | INTERNET_FLAG_PRAGMA_NOCACHE | INTERNET_FLAG_NO_CACHE_WRITE, (unsigned long)(&request_context));
return TRUE;
}
return FALSE;
}
-- modified at 7:01 Wednesday 22nd August, 2007
|
|
|
|
|
How can the "work offline" option in internet explorer be changed to "work online" using MFC.
Thanks in advance
|
|
|
|
|
InternetSetOption
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief
|
|
|
|
|
Has INTERNET_OPTION_OFFLINE_MODE been implemented?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
DavidCrow wrote: Has INTERNET_OPTION_OFFLINE_MODE been implemented?
naah... i am just looking for api InternetSetOffline.. but seems i missed the decalaration!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief
|
|
|
|
|
and you still in my signature
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief
|
|
|
|
|
|
As per libtiff mailing list , partial scanlines can' be read ?
Is there any other solution for this? or it can be done?
|
|
|
|
|
Hi
I have a remote PC with a Watchdog application running on it. This is monitoring the health of other applications runing on the PC, and if it detects a problem, will reset the PC. All applications are written in Visual c++, OS is XP home.
Is it possible to send a message over the network to the Watchdog app to instruct it to reset the remote PC?
Will FindWindow() work over a network (using the IP afddress of the remote machine), or is there another way of getting the handle of the Watchdog application?
Thanks for any advice you can give!
Mike
|
|
|
|