|
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.)
|
|
|
|
|
I'd go with STL
Regards,
Brian Dela
|
|
|
|
|
I have been thinking about one thing, if I don't use async sockets and make a multithreaded server.
How can my connected clients to the server communicate?
ie. A global std::list is toooo risky if two threads try to acces that object at the same time, right?
Rickard Andersson@Suza Computing
C# and C++ programmer from SWEDEN!
UIN: 50302279
E-Mail: nikado@pc.nu
Speciality: I love C#, ASP.NET and C++!
|
|
|
|
|
If it's multithreaded... yeah! Just use a mutex.
Then only one thread can read/write the gloabl shared data, the other thread(s) have to wait until the shared data is unlocked. Lock shared data as short as possible.
|
|
|
|
|
|
ah yes... I use it too.
CCriticalSection m_NodesListAccess; //synchronize access on lists/maps
m_NodesListAccess.Lock();
m_NodesListAccess.Unlock();
For some (strange) safety reasons I use it even in my async socket class, but I might be overprotective....
|
|
|
|
|
Moak wrote:
but I might be overprotective
yeah, like Britney Spears... LOL!
So if I access a global std::list between m_NodesListAccess.Lock(); and m_NodesListAccess.Unlock(); all other threads have to wait untill current thread has m_NodesListAccess.Ublock(); ?????
Cool... but... I'm not using MFC... I think this is an MFC class, right?
So, how to do it in Win32 API??
Rickard Andersson@Suza Computing
C# and C++ programmer from SWEDEN!
UIN: 50302279
E-Mail: nikado@pc.nu
Speciality: I love C#, ASP.NET and C++!
|
|
|
|
|
Rickard Andersson wrote:
So, how to do it in Win32 API??
Found an article here on CP!
Rickard Andersson@Suza Computing
C# and C++ programmer from SWEDEN!
UIN: 50302279
E-Mail: nikado@pc.nu
Speciality: I love C#, ASP.NET and C++!
|
|
|
|
|
Hi,
I cannot got my dll because of this
Creating library Release/AutoRecAndSave.lib and object Release/AutoRecAndSave.exp
LINK : warning LNK4089: all references to "comdlg32.dll" discarded by /OPT:REF
Tell me how to fix it.
Thank u in advance
Extreme programming. Do the No.1
|
|
|
|
|
What is there to fix?
Somewhere in your code you have included a line
#pragma comment(lib, "comdlg32")
but in the end (at link-time) it turns out you never used any function from that library/DLL and therefore it's discarded.
|
|
|
|
|
I mean, I can't make dll because of this, cannot MAKE DLL.
Extreme programming. Do the No.1
|
|
|
|
|
This is only a warning, so this can't be the cause that you can't build the DLL. I have this warning in a few DLL projects as well, but all compile fine anyway.
modified 12-Sep-18 21:01pm.
|
|
|
|