|
What function are you using to send an HTTP request? Some of the IE technologies don't allow you to get the response header.
Todd Smith
|
|
|
|
|
Thanks, Todd pal!
I am not using any specific browser. I just want to use
some client technology to see whether my web server runs
properly.
Do you have some ideas?
Cheers,
George
|
|
|
|
|
In that case here's the easiest way to get a response header
[www@staging2 apache]$ telnet www.codeproject.com 80
Trying 207.219.70.31...
Connected to www.codeproject.com (207.219.70.31).
Escape character is '^]'.
GET /index.html HTTP/1.1
host: test
HTTP/1.1 200 OK
Server: Microsoft-IIS/5.0
Date: Fri, 25 Oct 2002 16:46:38 GMT
Content-Length: 20307
Content-Type: text/html
Set-Cookie: LastVisit=10%2F25%2F2002+12%3A46%3A38+PM; expires=Wed, 23-Apr-2003 04:00:00 GMT; path=/
Set-Cookie: ASPSESSIONIDGQGGQZSK=LIPJNILADKDFHFMELBMDCJHE; path=/
Cache-control: private
Todd Smith
|
|
|
|
|
I found out how to display colored text in a rich edit control but am having a problem retaining the colored text when doing a ReplaceSel().
Is this normal? Is there a way around it? I mean is there another way of adding lines of text to a rich edit control without doing ReplaceSel?
I would like to keep adding text to this rich edit control and am using a method described here where you SetSel(0,-1), GetSelText(), then add my new text to it, and call ReplaceSel() to replace the entire contents of the rich edit control with the old and new text. But, if my old text was colored (only certain portions or certain lines are of different colors), the text is being overwritten to the default color - black text.
|
|
|
|
|
Hi,
A quick question with regards the above:
Can one use Crystal Reports in Visual C++?
And if so how does one go about doing that?
Thanks
Regards
Rui
|
|
|
|
|
You've a C++ SDK[^].
How low can you go ? (MS rant)
|
|
|
|
|
Yes you can do that.
Via COM it is possible to open reports, show them in a window (in a Crystal Reports Viewer ActiveX control), and perform all kinds of actions on it (print, mail, ...).
It is even possible to show the embeddable designer, and let you users design their own reports; within your application (although you need a separate license for this).
Normally the data for your report will come from a database (that's easy), but it's even possible to tell Crystal Reports that the data comes from within your application. However be careful, since CR 9.0 does not support the same functionality as CR 8.5. If you want to do this I suggest to go to CR 9.0 directly.
When you only want to show the report in your application, you don't have to pay any runtime royalty to CR (you can ship a free CR View-Only Runtime). However, if you want to create or modify reports from within your application, or let the user create or modify reports, you need a special RCAPI (Report Creation (or was it Component) API) license. This license is per named user, and costs about the same as a full Crystal Reports. This license and the Design-Time RunTime is mandatory ! simply installing Crystal Reports won't do the job.
Best way to get more information is to look at the crystal reports site, especially the developer zone (http://www.crystaldecisions.com/products/dev_zone[^]).
Enjoy life, this is not a rehearsal !!!
|
|
|
|
|
Hi Patje,
THank you very much for the information. May I ask you something else: The Crystal Reports that comes with Studio .Net, how does this fit in with what you are saying?
I notice that one can create a crystal report item for a C++ application, would this be the report that is called by the Crystal Reports Viewer ActiveX control?
Thanks
Regards
|
|
|
|
|
I don't know anything about the CR that comes with VS.Net, but I assume that it's a kind 8.5.Net version, not the brand new CR 9.0.
We are using the CR ActiveX control by using the "AtlAxWin" control (part of ATL 3.0) and passing it
- "CrystalReport.EmbeddableCrystalReportsDesignerCtrl.8.5" for the embeddable designer
- "CRViewer.CRViewer.8.0" for the ActiveX viewer
Then use ATL::AtlAxGetControl to get the IUnknown interface of the ActiveX control hosted in the AtlAxWin control.
ATL::AtlAxGetControl (NativeWin, &UnknownInterface);
Then use IUnknownInterface->QueryInterface to get the interface to the CRVIEWERLib::ICrystalReportViewer4Ptr.
hr = UnknownInterface->QueryInterface (__uuidof(CRVIEWERLib::ICrystalReportViewer4),(void **)&CrystalReportViewer);
or for the designer:
hr = UnknownInterface->QueryInterface (__uuidof(CRDESIGNERCTRLLib::ICRDesignerCtrl),(void **)&CrystalReportDesigner);
Then simply use
CrystalReportViewer->ReportSource = MyReport
to set the report in the viewer (similar for the designer).
Don't forget to import the necessary type libraries:
#import "CRAXDDRT.tlb"
#import "CRAXDRT.tlb"
#import "crviewer.tlb"
#import "CRDesignerCtrl.tlb"
Also take a look at the generated .tli and .tlh files (by the #import). They're also very interesting if you want to know some of the more technical details.
Hope this helps (this was one of my first C++/COM projects, a real C++/COM guru might write this maybe a bit more efficient).
Enjoy life, this is not a rehearsal !!!
|
|
|
|
|
Hi guys
How can I change the color of the EditBox part of a CComboBox?
I don't want to change the list color, only the edit box part.
Best regards
Jordi
|
|
|
|
|
Probably wanna look into CWnd::OnCtlColor as one solution...and by far the easiest...
There is also Ownerdrawing as an option, but thats ALOT of work...
So look into the above first
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
Hello,
i have to write an activex-control, that can recieve the rate of exchange for a securitypaper from a server in the internet. But at this time i have no idea how to access a server and how to recieve the information. Has anyone out there an idea or can give me a link to a description how to do this. Help would be very appreciated.
Best regards
tabor25
|
|
|
|
|
HI
How can i calculate that how much length and height of any text will take
with any font before displaying with Device Context.
thanks in anticipation for any hint or solutions.
bye.
|
|
|
|
|
You can use GetTextExtentPoint32 (API) or CDC::GetTextExtent (MFC) for that purpose.
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
i am to set the size of font such that specified text always comes with in
some specified rectangle. for this purpose i am using
CSize sz =pDC->GetOutputTextExtent(*txt);
it works . but problem is that it is very slow as there are many times font
is to be selected in pDC with a higher font size.
has any body done it in some other way or some hint.
All i want is to display text in a rectangle making the size of the
font such that text fits in the rectangle.
thanks in anticipation.
|
|
|
|
|
This is actually a reply to your next question, but the way the threads unfolded that would require me to click back and i'm to lazy...
So...
I would suggest looking into using DrawText() with the DT_CALCRECT style...
With this you can specify the width of the required rectangle and the geven text and it will calculate the height required for full display...very cool!!!
Cheers!
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
Hi,
How can I make simple textlinks in my AboutDlg?
For example; "Visit my homepage at http://icc.makes.it"
Thanks
/Ola Carlsson
|
|
|
|
|
There are several solutions. Consider these Win32 API.
CreateProcess()
ShellExecute()
WinExec()
In general, you will pass in a null-terminated string of the URL. CreateProcess() will require iexplorer.exe in addition to the URL.
Kuphryn
|
|
|
|
|
Take a look at Chris Maunder's excellent Hyperlink Control[^]
Roger Stewart
"I Owe, I Owe, it's off to work I go..."
|
|
|
|
|
thank you very much!
/Ola Carlsson
|
|
|
|
|
Ok here is the question/problem: I work for a telecommunications company and we have two large files that we have to do a compare process on. The first file is appx. 700mb and the other is about 15 - 20% larger. From what I know now there is a sequence number as part of the records and there are four fields that we can use to check in one file against the other to compare for uniqueness. We may purchase a dedicated server to run this application. There will be only a little database activity, but it would only identify specific files (i.e. - not the main process at all). The question come in as to what language to use, any of the above are possible, as is VB, but lets stay away from that issue right now. My thought is that you can use the STL in C++ and all the fun algorithms that come with it. I am not as sure about MFC's searching ability. C# has some nice classes also. What do you think?
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
|
|
|
|
|
It seems this application is 1) I/O-bound to get the large amount of data from disk to memory and then 2) CPU-bound to do the matching/searching/comparison.
For the I/O tasks you could use just about any language.
However, for the "meat" I couldn't even imagine using any other language than C/C++ (unless, of course, I was a Delphi zealot ).
Also, ask yourself "Am I prepared that this application might break at the next whim of Microsoft when they again change 'subtle' stuff of a language, or do I want to know that code I write today can be run even 10 or 20 years from now"?
If you want continuity, use what is known to work: C or C++. If you're willing to take a chance, use whatever any manufacturer is the only producer of.
|
|
|
|
|
Sometimes it's easier and more flexible to BCP the file to a SQL Server database, indexing it and doing a simple join on the tables.
I know you can code something faster than this, but I've seen plenty of proprietary solutions for this kind of thing which are slower than this...
Q261186 - Computer Randomly Plays Classical Music
|
|
|
|
|
Daniel Turini wrote:
Sometimes it's easier and more flexible to BCP the file to a SQL Server database, indexing it and doing a simple join on the tables.
I already asked and this is not an option.
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
|
|
|
|
|
Start with C++ and use memory mapped files. (Last year I wrote a module that accepted huge text files of data pushed out from an Oracle server. My first prototype used buffered I/O to read the files. I then switched to using memory mapped files and good old pointers and reduced the parse time by over 90% (seriously--it went from several minutes to under 5 seconds.))
For lookups, there are various schemes, but a Trie may be the best for this. Be aware, however, than many implementations allocate each node. This will slow you down tremendously. What you want is a fixed memory allocator. (Yes, I have such a class and am debating publishing an article on it, but the current implementation relies on my personal class library which is, to say the very least, ecletic.)
|
|
|
|