|
You can do one of a couple things:
1. Look at the CInternetSession documentation. i think there is a way to get it so that calls can be made asynchronously - then the calls won't block completely, you'll be able to do other stuff.
2. Write your own FTP routines that don't block.
Good luck.
Even if you win the rat race, you're still a rat.
|
|
|
|
|
The wininet support asynchrnous processing , so it's perhaps your best bet ...
You should never terminate a thread by the wicked TerminateProcess() and TerminateThread !!!!!!! Period !!!! It's doesn't clean up nicely ...
You have 2 ways of stopping a threading , one is waiting the thread for finnishing , duh , the other is to signal a kernel object Event,Mutex to the thread that you want to terminate, this thread is waiting on it with a WaitForSingleObject and alike functions ...
Or you only program with Win"k or XP, you can use jobs to safely terminate a thread or a bunch of threads ... check the api CreateJobObject ... I think that VC6++ compiler if I'm not mistaken uses this technique to stop the threads ... on Win2k
Cheers,
Joao Vaz
And if your dream is to care for your family, to put food on the table, to provide them with an education and a good home, then maybe suffering through an endless, pointless, boring job will seem to have purpose. And you will realize how even a rock can change the world, simply by remaining obstinately stationary. - Shog9
|
|
|
|
|
Hi everybody,
I've implemented QueryStatus of the IOleCommandTarget interface. It looks like this:
interface IOleCommandTarget : IUnknown
{
[helpstring("method Exec")]
HRESULT Exec(
[in] const GUID *pguidCmdGroup,
[in] DWORD nCmdID, [in] DWORD nCmdExecOpt,
[in] VARIANTARG *pvaIn,
[in,out] VARIANTARG *pvaOut);
[helpstring("method QueryStatus")]
HRESULT QueryStatus(
[in] const GUID *pguidCmdGroup,
[in] ULONG cCmds,
[in,out] OLECMD *prgCmds,
[in,out] OLECMDTEXT *pCmdText);
};
But, when I try to compile the idl file I receive this error;
Creating Type Library...
Microsoft (R) MIDL Compiler Version 5.01.0164
Copyright (c) Microsoft Corp 1991-1997. All rights reserved.
Processing E:\development\COM experiments\ProxyObj\ProxyObj.idl
ProxyObj.idl
Processing D:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\oaidl.idl
oaidl.idl
Processing D:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\objidl.idl
objidl.idl
Processing D:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\unknwn.idl
unknwn.idl
Processing D:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\wtypes.idl
wtypes.idl
Processing D:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\ocidl.idl
ocidl.idl
Processing D:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\oleidl.idl
oleidl.idl
Processing D:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\servprov.idl
servprov.idl
Processing D:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\urlmon.idl
urlmon.idl
Processing D:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\msxml.idl
msxml.idl
E:\development\COM experiments\ProxyObj\ProxyObj.idl(59) : error MIDL2025 : syntax error : expecting a type specification near "OLECMD"
E:\development\COM experiments\ProxyObj\ProxyObj.idl(59) : error MIDL2026 : cannot recover from earlier syntax errors; aborting compilation
Error executing midl.exe.
ProxyObj.tlb - 2 error(s), 0 warning(s)
Any idea why? Should I include something special?
Thx,
/Tommy
|
|
|
|
|
this is code of gotoxy, i have made in c++ using assembly, but it is not working and giving an error of invalid operand.
plz help!!!!
void _gotoxy(int row,int cols)
{ asm MOV AH,0x2
asm MOV DH,row// problem is here,if we use
asm MOV DL,cols//constant here, it works
asm MOV BH,0x0
asm INT 0x10
}
void main()
{ clrscr();
_gotoxy(15,15);
printf("x");
getch();
}
|
|
|
|
|
Just a guess (it's been a long time ), but aren't DH and DL only 8 bits?
Try this:
void _gotoxy(int row, int col)
{
asm
{
mov ah, 2
mov bh, 0
mov dh, row & 0xff
mov dl, col & 0xff
int 0x10
}
}
CPUA 0x5041
Sonork 100.11743 Chicken Little
"So it can now be written in stone as a testament to humanities achievments "PJ did Pi at CP"." Colin Davies
Within you lies the power for good - Use it!
|
|
|
|
|
i have checked that but it is not working, suggest any thing else, plz help!!!!
|
|
|
|
|
The only other thing I can think of would be to use char instead of int .
void _gotoxy (char x, char y)
otherwise I have no idea why it would work with a constant and not a variable. I do not have Turbo C++ to test it myself. What does your manual say about using variables in inline assembly?
CPUA 0x5041
Sonork 100.11743 Chicken Little
"So it can now be written in stone as a testament to humanities achievments "PJ did Pi at CP"." Colin Davies
Within you lies the power for good - Use it!
|
|
|
|
|
Hey Im not a real advanced programer or anything, but when I use Turbo C++ in class, I can include <stdio.h> and freely use gotoxy(int,int); thoughout the program to move the cursor to a certain spot on the screen and print something there. What the hell is up with visual c++. It's telling me that gotoxy(int,int); is an "undeclared identifier". Well Im lost...
|
|
|
|
|
I'm looking for a (speedy) class/algorithm to convert Paradox/Excel date serials to a day-month-year value and back.
VictorV
|
|
|
|
|
|
The Paradox/Excel serial date is the number of days since 1-1-1900. I was wondering if anyone knew a fast algorithm to convert a serial date to day-month year and vise versa...
VictorV
|
|
|
|
|
Hello,
I need to change the font of a property sheet tab from the same tab.
Let's say that in that tab there is the control of alarms and emergencies that can happen in a machine that I control. when a new alarm or emergency happens I want to be able to change the color of the "alarms and emergencies" tab.
As always thank you in advance.
NOTE:
I want only to change the font of the "alarms and emergencies" tab, the other ones should keep the same font than before.
|
|
|
|
|
|
There is a function SetAutoURLDetect suporrted by CRichEditCtrl as per MSDN but when actually called there is no such function in the header file . there is a compiltion error can anybody help me ?????
|
|
|
|
|
|
|
I have a initialized a bitmap with a bitmap info header,which i have mentioned of bitcount=1(monochrome bitmap).I want to get the bits of the bitmap.Is it possible to get the bits by using function called GetDIBits for a monochrome bitmap.
|
|
|
|
|
Is there any reason you can't create it as a DIBSECTION ? Then you'll have a pointer to the bits by default.
Christian
We're just observing the seasonal migration from VB to VC. Most of these birds will be killed by predators or will die of hunger. Only the best will survive - Tomasz Sowinski 29-07-2002 ( on the number of newbie posters in the VC forum )
|
|
|
|
|
Do u mean that if i use createDIBSection api,i can get the pointer to access the bits.
Please all tell the procedures.i have just initialized the bitmap info header.Afterwards i dontknow what to do.
|
|
|
|
|
BITMAPINFO bmInfo;
memset(&bmInfo.bmiHeader,0,sizeof(BITMAPINFOHEADER));
bmInfo.bmiHeader.biSize=sizeof(BITMAPINFOHEADER);
bmInfo.bmiHeader.biWidth=width;
bmInfo.bmiHeader.biHeight=height;
bmInfo.bmiHeader.biPlanes=1;
bmInfo.bmiHeader.biBitCount=24;
HDC pDC = ::GetDC(0);
HDC TmpDC=CreateCompatibleDC(pDC);
BYTE *pbase;
HBITMAP TmpBmp=CreateDIBSection(pDC,
&bmInfo,DIB_RGB_COLORS,(void**)&pbase,0,0);
HGDIOBJ TmpObj=SelectObject(TmpDC,TmpBmp);
|
|
|
|
|
I have created an image transfer system using the UK GSM network. When the send and receive ends are both on my desk (both modems in the same GSM cell), then I have no problems at all, the system and the software work perfectly.
However, as soon as the ends are separated by any reasonable distance (in to a new GSM cell) the system falls over. Having done some extensive playing aroundtesting I have managed to discover that the modems response to dialing any out of cell number is 'NO CARRIER'. Unfortunately I have very little comm.s experience and even less experience with GSM comm.s.
I can write the most clever code in the world, but if I can't get a call to connect it's a waste. Does anyone have any ideas as to what's occurring here?
Derek Lakin.
I wish I was what I thought I was when I wished I was what I am.
Salamander Software Ltd.
|
|
|
|
|
How do I do it? :-P
I want to enable copying from a CScrollView derived class the selected data in text format. The clipboard stuff I can do, but what is bugging me is whether I really have to code the selection stuff myself.
|
|
|
|
|
Anonymous wrote:
what is bugging me is whether I really have to code the selection stuff myself.
Yes, you'll have to do that yourself. What kind of information are you displaying in CYourView?
Tomasz Sowinski -- http://www.shooltz.com
- It's for protection - Protection from what? Zee Germans?
|
|
|
|
|
Thanks for your answer, even though it is not what I wanted to hear .
The document content is just plain text.
|
|
|
|
|
Anonymous wrote:
The document content is just plain text.
You may consider switching to CEditView or CRichEditView then.
Tomasz Sowinski -- http://www.shooltz.com
What is "scratch" and why can everything be made from it?
|
|
|
|