|
SatyaKiran wrote:
intercept http
If you need to "intercept http", it will be a lot easier for you if you write a proxy, not a firewall. There are samples here in Codeproject of proxies that do this.
My latest article:
SQL Server DO's and DONT's[^]
|
|
|
|
|
I am reading from an XML file and I need to convert a value from the variant string that I get to a double. How do I go about doing something like that?
|
|
|
|
|
atol, and use _bstr_t to convert your string into a char * first. If you put the string into a _bstr_t, the conversion to char * is implicit.
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002
|
|
|
|
|
Actually, I think you can shove it into a variant_t and ask it to ChangeTo a double.
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002
|
|
|
|
|
Thanks for your help, it sent me on the right track. After playing with ChangeType I found out that
the variant_t will do the conversion for me as it has the double() operator overloaded.
Thanks Again,
Clint
|
|
|
|
|
Great - glad to help. My experience with variant_t and VARIANT is limited, so I have only a vague idea.....
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002
|
|
|
|
|
I am looking for a way to programmatically convert MIDI data to sound data (such as WAV) and then have that handed back to my program or saved to a file. Although I have found plenty of stuff about waveout functions, DirectX, DirectSound, etc., it seems as though the results of the soundcard processing always head straight out to the speakers. Is there a way that I can register my program (or a file) as the destination of the sound generator so that I can effectively convert MIDI to WAV and then do further processing on that sound data? Any ideas are appreciated.
|
|
|
|
|
ADO: how can u access the number of records in a given table again?
-- WITHOUT having to enumerate all records and increment some sort of counters?
thanks
norm
|
|
|
|
|
select count(*) from tblMyTable.
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002
|
|
|
|
|
i'm so stupid. sorry =)
norm
|
|
|
|
|
No worries - I've asked dumber questions. I believe the response you get from ADO is a single cell called 'count', so that is what you need to select. ADO.NET has executescalar, which is far nicer.
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002
|
|
|
|
|
hehe, it's my turn:
SELECT COUNT(*) AS "WHATEVER_NAME" FROM MYTABLE
norm
|
|
|
|
|
*grin* I know, but I thought you may not be aware what it comes back as, and that it might be hard to find out. I forget the vagaries of ADO, I'm in ADO.NET land nowadays.
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002
|
|
|
|
|
let me have my moment of pride =)
ye, hope to move on to dot-net real soon. just have to finish off two small jobs: a connection manager and an installer/un-installer.
norm
|
|
|
|
|
norm wrote:
let me have my moment of pride =)
Oh - sorry. Thanks for the tip, then
norm wrote:
ye, hope to move on to dot-net real soon.
You will love it. The Microsoft ADO.NET Core Reference book is a must have if you're going to use ADO.NET.
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002
|
|
|
|
|
Not wise to quote the table pseudonym.
select count(0) as [whatever] from table (nolock)
is the best way to do it in SQL Server.
However, if you're going to select all the data anyway, you'll end up doing two queries which is not necessary. In that case, just select the data and look at Recordset.RecordCount . Only works on client based recordsets though.
#include <beer.h>
|
|
|
|
|
Christian Graus wrote:
select count(*) from tblMyTable.
Actually ADO exposes a property called RecordCount once you have returned a recordset, so you don't actually have to do a "SELECT COUNT(*) FROM [YourTable] WHERE..." . You will need to set the CursorType to 3 (which represnts a static cursor).
Nick Parker
May your glass be ever full.
May the roof over your head be always strong.
And may you be in heaven half an hour before the devil knows you’re dead. - Irish Blessing
|
|
|
|
|
Ya, but I didn't think it was implicit in the question that he had a recordset already.
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002
|
|
|
|
|
Christian Graus wrote:
Ya, but I didn't think it was implicit in the question that he had a recordset already.
I know, I was just commenting on something that wasn't said yet in case someone wanted to use it in the future.
Nick Parker
May your glass be ever full.
May the roof over your head be always strong.
And may you be in heaven half an hour before the devil knows you’re dead. - Irish Blessing
|
|
|
|
|
You're right, of course. To be honest, I was aware that there was a property, but didn't mention it because I could not recall then name, and did not look it up because it did not seem to be exactly what was needed.
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002
|
|
|
|
|
why "INT" and not "int" again?
thanks
norm
|
|
|
|
|
They are the same thing, but INT is a macro, presumably so one day Microsoft has the option to turn them all into longs or something. Personally I use the macros whenever I call a Microsoft API that uses them, otherwise I always use C++ standard types.
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002
|
|
|
|
|
how can i display a save dialog with the same w2000 style, like explorer or notepad does? is there any function like GetFileNameFromBrowse. It looks easy and why not for save.
TCHAR szFile[_MAX_PATH]=_T("");
TCHAR *szFilters=_T("Files (*.fil)\0*.fil\0All\0*.*\0");
TCHAR *szTitle=_T("Open");
GetFileNameFromBrowse(GetSafeHwnd(),
szFile,
sizeof(szFile),
NULL,
NULL,
szFilters,
szTitle)
Thanks.
|
|
|
|
|
My app has 2 report-style list view controls with subitems:
http://igx89.digitalrice.com/wpicons.jpg[^]
I'm having problems with the subitems images centering, as you can see Here's the code I use to add the column:
Col.mask = LVCF_IMAGE | LVCF_SUBITEM | LVCF_FMT;
Col.iImage = IDI_ACTIVISM;<br />
Col.iSubItem = 1;<br />
Col.fmt = LVCFMT_IMAGE;<br />
PlayerListCtrl.InsertColumn(1,&Col);
and the code to add the subitems:
PlayerListCtrl.SetItem(nItem,1,LVIF_IMAGE,0,IDI_MODERATOR,0,0,i);
How can I make the subitem images centered? Thanks!
|
|
|
|
|
The alignment value only affects the text for the subitem, not the image. To center the image, you will have to use custom draw.
Software Zen: delete this;
|
|
|
|
|