|
I suggest sending the array of points when the user releases the mouse.
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
My suggestion would be this:
try to monitor the sent string and when the client reveives something just send it back and check what he has reveived. If it is the correct string pass on to the next if not send the client a string telling him that he should wait for another string.
This might make even more lag but at least you will know you got it right.
gabby
|
|
|
|
|
well, i should have explained the scenario better. It's a jabber client, something like msn messenger. I send the strings to the server, and the server sends the strings to the other client.
that's why i have the order problem. Every point is sent, so there are no errors when i send them.
javi's idea is fine i think.
|
|
|
|
|
Is it possible to capture the "network cable unplugged" event that appears in a balloon tip on the notification area in Windows NT 5+?
I tried by making a thread to monitor the appearance of the balloon, but I cant get it to work.
Is there a better way of doing this??
Bikram Singh
|
|
|
|
|
Rather than bother with a tooltip that may or not may not be available, go directly to the source.
On a WAN (e.g., VPN), you can use SENS, specifically the ISensNetwork interface. If it is a LAN, you'd need to use WSAIoctl(SIO_ADDRESS_LIST_CHANGE) .
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Thanks !
I managed to get it working, by using IP Helper functions.
I dont understand COM sinks very well, so I'm avoiding ISensNetwork for now...
Bikram Singh
|
|
|
|
|
Hello Everyone
I am trying to automate a database update (that involves some business logic) using a windows service. The constraints are that
1. I cannot write the service in .NET
Hence I opted to write the service as a C++ executable.
In the service, I have a call using ODBC API (ExecuteSQL method) to a SQL Server Stored procedure just before the call to Sleep method.
The problem is that the call to the stored proc to be executed does NOT work. But the Service installs/uninstalls/starts/stops fine.
If I strip off the code for the service and just run the ODBC part of it, it works fine.
I would like to know if there are issues that need to be taken into account if I make a ODBC call in an NT Service.
I will greatly appreciate any inputs on this.
Thanks
Anand
|
|
|
|
|
By default, a windows service is using the "local system" account, which does not have access to user settings (registry keys, odbc data sources, etc.). It is likely that your odbc data source is a "user" source instead of a "system" source. You need to configure it to "system" data source and you probably have to reboot the machine afterwards.
Good luck.
My articles and software tools
|
|
|
|
|
Hi All,
Need help regarding stored procedure concept using CDatabase & Crecordset database classes. I am working on MFC
application which supports all major RDBMS databases(SQL Server, MySQL, Oracle & MS-Access). I have to process thousands of records from a file and do insert operations.
Right now, this is what I am doing
1. Read one record from a file. Parse it and prepare query.
2. Executing it by using cDatabase's ExecuteSql() function.
But it is taking very long time to process thousand's of records. Every time database has to process the query and prepare an execution plan. That's the reason why I need to solve this problem by using stored procedures which should work with all the databases.
I appreciate if someone could help me in this regard.
Thanks,
Sridhar
|
|
|
|
|
Would using CRecordset::AddNew() and CRecordset::Update() be any faster? I've never directly used CDatabase::ExecuteSQL() to add rows to a table so I'm not sure which method would be more efficient.
You might want to give ExecuteSQL("BULK INSERT...") a look. If you can format your file to look like the table format, it just might work.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Hi David,
Did you have any example of Bulk Insert functionality? Does it work with all the databases?
Thanks,
|
|
|
|
|
Sridhar Sanikommu wrote:
Did you have any example of Bulk Insert functionality?
Possibly. Assuming the table looks like:
Name Type
---- ----
col1 char(3)
col2 int Create a file named mydata.txt that looks like:
abc,1;def,2;ghi,3; Load this file into the table with:
BULK INSERT <table name here>
FROM 'mydata.txt'
WITH
(DATAFILETYPE = 'char',
FIELDTERMINATOR = ',', ROWTERMINATOR = ';') Sridhar Sanikommu wrote:
Does it work with all the databases?
Having not used "all the databases," I couldn't possibly know.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Hi David,
I appreciate your quick response. This is the first time I posted my question in code project though I opened my account long time back(almost two years) and been following message board Q&A's. Especially, if I encounter responses from yourself, Micheal Dunn, Ravi, Prakash(you people are top of my head) etc I go through the techniques that you guys suggest.
Keep going....pass your knowledge and empower others.
BTW, do you have any generic database module(using CDatabase & CRecordset classes) which I can get?
Thanks,
Sridhar
|
|
|
|
|
I have a question regarding copying of whole compressed (DIVX) streams with the AVIFile API.
This code snippet copies the video stream to another file, but that file gets about 10 times bigger than the original. I guess the target stream is uncompressed, but the streaminfo explicitely states DIVX.
How can I copy streams from one file to the other without decompressing/compressing (direct stream copy)?
<br />
HRESULT hr=S_OK;<br />
<br />
PAVIFILE pSourceFile=NULL;<br />
PAVIFILE pTargetFile=NULL;<br />
<br />
PAVISTREAM pSourceStream=NULL;<br />
PAVISTREAM pTargetStream=NULL;<br />
<br />
AVISTREAMINFO streaminfo;<br />
BITMAPINFOHEADER bitmapinfo;<br />
<br />
AVIFileInit();<br />
<br />
hr=AVIFileOpen(&pSourceFile,"test_source.avi",OF_SHARE_DENY_WRITE,0L);<br />
if(FAILED(hr))<br />
...<br />
<br />
hr=AVIFileGetStream(pSourceFile,&pSourceStream,streamtypeVIDEO,0);<br />
if(FAILED(hr))<br />
...<br />
<br />
LONG bitmapinfosize=sizeof(bitmapinfo);<br />
hr=AVIStreamReadFormat(pSourceStream,0,&bitmapinfo,&bitmapinfosize);<br />
if(FAILED(hr))<br />
...<br />
<br />
hr=AVIStreamInfo(pSourceStream,&streaminfo,sizeof(streaminfo));<br />
if(FAILED(hr))<br />
...<br />
<br />
hr=AVIFileOpen(&pTargetFile,"test_target.avi",OF_CREATE|OF_WRITE,0L);<br />
if(FAILED(hr))<br />
...<br />
<br />
hr=AVIFileCreateStream(pTargetFile,&pTargetStream,&streaminfo);<br />
if(FAILED(hr))<br />
...<br />
<br />
hr=AVIStreamSetFormat(pTargetStream,0,&bitmapinfo,sizeof(bitmapinfo));<br />
if(FAILED(hr))<br />
...<br />
<br />
LONG lbuffersize=20000;<br />
BYTE* buffer;<br />
buffer=new BYTE[lbuffersize];<br />
<br />
LONG lPos=0;<br />
LONG lLen=0;<br />
for(long lPos=AVIStreamStart(pSourceStream);lPos<AVIStreamEnd(pSourceStream);lPos++)<br />
{<br />
hr=AVIStreamRead(pSourceStream,lPos,1,buffer,lbuffersize,&lLen,NULL);<br />
if(FAILED(hr))<br />
...<br />
<br />
DWORD dwFlag=0;<br />
if(AVIStreamIsKeyFrame(pSourceStream,lPos))<br />
dwFlag=AVIIF_KEYFRAME;<br />
<br />
hr=AVIStreamWrite(pTargetStream,lPos,1,buffer,lbuffersize,dwFlag,NULL,NULL);<br />
if(FAILED(hr))<br />
...<br />
}<br />
<br />
if(pTargetStream)<br />
AVIStreamRelease(pTargetStream);<br />
<br />
if(pTargetFile)<br />
AVIFileRelease(pTargetFile);<br />
<br />
if(pSourceStream)<br />
AVIStreamRelease(pSourceStream);<br />
<br />
if(pSourceFile)<br />
AVIFileRelease(pSourceFile);<br />
<br />
delete[] buffer;<br />
<br />
AVIFileExit();
using: [VISUAL STUDIO 6.0 sp5] [WIN98/2]
|
|
|
|
|
I'm using TerminateProcess to shut down explorer.exe (not iexplore.exe). This works, but a few seconds after explorer.exe is terminated, it starts back up. When I terminate explorer though the Windows Task Manager it doesn't restart itself.
I want to control when exporer.exe starts back up. How do I keep it from restarting itself?
(I can post my code if anyone thinks it's necessary.)
Thanks for the help!
Ian
|
|
|
|
|
haven't you ever noticed that when windows freezes and you have no desktop and no taskbar anymore, you can do "New task" (with Crtl+Alt+Del or Ctrl+Shift+Esc for example) and type in the field explorer...
i don't think the way you think is able to controle what you want.
TOXCCT >>> GEII power
|
|
|
|
|
I'm not sure I follow you. I want to shut down explorer.exe. This I have done (I can see it dissapear from the process list in Windows Task Manager).
Now I need to figure out how to keep it from starting itself back up. I know this is possible because I have seen other applications that shut it down and keep it down. I don't suppose they continually shut it down in a separate thread?
|
|
|
|
|
|
|
oooppss, didn't see that you had the answer
|
|
|
|
|
Hi,
i created a toolbar using CreateWindowEx() but i got no XP toolbar (im using xp).
how can i make it so?
|
|
|
|
|
I am not looking to create, rather I am more looking for advice on something to buy.
I would like to be able to scan in paper forms and use a tool to convert the image into a form that C++ can use.
If such a tool does not exist, can you point me towards a tool that would build HTML or other interface from a paper form.
thanks
|
|
|
|
|
I found that a word doc file can be saved as HTML.
But how can I save a HTML as a word DOC?
Any ideas? Thank you very much!
Alick
|
|
|
|
|
|
I have a question during providing services to some users.This product should get this result:First,push the button on the dialogue; then the excel form should appear;and last,when I choose any row, the data of this row can be read by the program.Anyone know how to achieve this function? Thanks!
|
|
|
|