|
FILE *fp = fopen(filename, "a");
fprintf(fp, "%d,%d", a, b);
fclose(fp);
-c
When history comes, it always takes you by surprise.
|
|
|
|
|
oh! Thanks!
My fix-minimum-dimensions idea is flawed. I tried in OnSize()
if (cx > 120 && cy > 130)MoveWindow(left, top, cx, cy) where top and left are from Crect cRect and GetClienRect.
Two things: 1. It scooted my dlg to 0,0 on the screen instead of where it was so I amggoing to try getwindowplacement. The other and more serious thing is that it flickers greatly asI try to oversize it and it snaps back...
Whats the smart way that I'm not seeing of doing this fix-minimum?
Appreciate your help,
ns
|
|
|
|
|
GetWindwoRect is good , but not gEtClientRect ...why ?
ALos the flicker still remains
Appreciate your help,
ns
|
|
|
|
|
Hello,
I need to embed the Microsoft Internet Explorer Control...
Unfortunately I cannot use the MFC classes CHtmlView etc, the project doesn't use MFC.
How can I embed the Internet Explorer? Any tutorial, link, hint?
-Dominik
|
|
|
|
|
|
I've to display a previously readed RAW image: I've stored image data into a LPBYTE buffer, then I read every 24bit to get RGB code.
If the image size is lower than 12528000 byte (2000x2088 pixel) there's no problem, but if I exceed this size, I can't get no more bitmap created in the memory DC.
This is my code:
<br />
CBitmap* oldBmp;<br />
CProgressBar loadBar("Loading RAW data", 40, m_BmHeight*m_BmWidth);<br />
<br />
m_pVHDbmp = new CBitmap;<br />
int bmpResult = m_pVHDbmp->CreateCompatibleBitmap(pDC, m_BmWidth, m_BmHeight);<br />
TRACE("CVHDImage::CreateVHDBitmap - CreateBitmap result : %d\n", bmpResult);<br />
<br />
oldBmp = memDC->SelectObject(m_pVHDbmp);<br />
BYTE* tmpPtr = m_pDIBbits;<br />
UINT sizeByte = sizeof(tmpPtr);<br />
DWORD curY, curX;<br />
COLORREF tmpColor;<br />
loadBar.SetStep(m_BmWidth);<br />
for (curY = 0; curY < m_BmHeight; curY++){<br />
for (curX = 0; curX < m_BmWidth; curX++){<br />
CPixel* curPixel = new CPixel(*tmpPtr, *(tmpPtr+1), *(tmpPtr+2));<br />
tmpColor = memDC->SetPixel(curX, curY, curPixel->GetColorRef());<br />
tmpPtr+=3;<br />
delete curPixel;<br />
}<br />
loadBar.StepIt();<br />
}<br />
memDC->SelectObject(oldBmp);<br />
When I set m_BmWidth and m_BmHeight so that height*width>4176000 pixel (24 bit per pixel) the bmpResult is set to 0.
Why?
Is there a limit to bitmap creation size?
Thanks
|
|
|
|
|
Anonymous wrote:
Why?
Is there a limit to bitmap creation size?
Yes. You just hit it.
Joel Lucsy
|
|
|
|
|
So I've to split the 35MB raw image into two bitmaps or there's a secod way?
|
|
|
|
|
With such large images as that (up to about 700MB),
I've had good results by creating a DIB section for
just the viewable area needed (a "window" on the image)
and directly copying the image data into the DIB before
blitting to screen. The main image remains just the
raw data and you only use pieces of it as required.
|
|
|
|
|
I didn't try this way yet, but I think it's the same, as I've got to let the user zoom in and out, so when the zoom will be set as "fit in window", I've got to create a DIB section big enough.
And there we are again...
|
|
|
|
|
Make your DIB always as big as the viewable area in the display,
not the source. Then it is all a matter of how you fill that
DIB section. If you will be zooming, you'll have to do a bit
more than simply copying pieces of scan lines. You have to
resample or interpolate from the RAW image. For performance, you
may wish to limit zooming out to discrete steps and for large
zoom factors, you may even use a pre-resampled image that can
interpolated up or down for the final display.
|
|
|
|
|
I tried installing VC7 a while ago, and ended up having to remove it. Once I did that, I was no longer able to run 16-bit programs on my NT machine. I have been searching the web since then for an answer to this but cannot find anything.
Does anyone have any idea how I can get my NTVDM.EXE back running properly again? It just sits there at 99% until I kill it.
Ugghh!
|
|
|
|
|
See if there are invalid characters in your winnt\system32\config.nt or winnt\system32\autoexec.nt. (look at environment vars too)
You can compare these files with the same files in winnt\repair.
Reapply your NT Service pack (maybe some of the WOW files have become corrupt).
Hope it helps..
Rob
Whoever said nothing's impossible never tried slamming a revolving door!
|
|
|
|
|
Thank you very much.
I did some more searching, and found some information leading me to the same files you mentioned. I think it may have been a problem that I introduced, and not the VC7 installation.
I added
PATH=%PATH%;C:\utils\
to one of the files, (I may be wrong about the exact syntax). The idea was that I could use programs from my c:\utils when in a DOS window. It worked fine when using the DOS window but running 16-bit apps always failed.
I took this line out, and things are back to the way they were long ago.
Thank you very much for responding, and with the correct diagnosis.
|
|
|
|
|
Hi, I'm using Visual C++ 6 to build an ATL component, and I'm pointing my debug exe at the c:\program files\vs...\VB.exe and making the parameter a small test harness project in VB.
Now when I hit F5 to compile/launch my Component in VB the very first time I do it everything is fine. Any subsequent attempts result in VB not starting, and not being able to Kill or even get Task Manager to come to the front... My only option is to log off and start again.
I've got VS sp5 installed. And W2k Srv sp3
Any ideas what I may be doing wrong??
|
|
|
|
|
Compile your code, into vbApp.exe. Run VBApp and attach bugger to it.
Don't use vb.exe!
|
|
|
|
|
thanks this works..
But my other technique works on my other computer. (Attaching to VB, and tripping when invoking my component)
How would I be able to find what has changed?
|
|
|
|
|
Found the problem.
The machine debug manager for Visual Studio 7 was started on the machine.
I disabled the service, and everything is back to normal
|
|
|
|
|
I want to write application that get mail from POP3 server with socket.I stablish a connection to POP3 server and send username to it with POP3 command(USER XXXXXX) like this:
m_socket.Connect(serverstr,110);
char buffer[256];
UINT uiport;
CString username;
m_usernameEdit.GetWindowText(username);
username = "USER " + username +"\t\n";
m_socket.Send(username.GetBuffer(),username.GetLength());
First I want to know if this is correct way and my second question is how can I get the status from POP3 (+OK) so I can find out I've done the proccess correctly?
Mazy
"And the carpet needs a haircut, and the spotlight looks like a prison break
And the telephone's out of cigarettes, and the balcony is on the make
And the piano has been drinking, the piano has been drinking...not me...not me-Tom Waits
|
|
|
|
|
Check out the many examples here at cp.com about pop3, you'll definately find your answer there
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
OK,Thanks.
Mazy
"And the carpet needs a haircut, and the spotlight looks like a prison break
And the telephone's out of cigarettes, and the balcony is on the make
And the piano has been drinking, the piano has been drinking...not me...not me-Tom Waits
|
|
|
|
|
Hi,
I have programmed a program with Dialogs, menu's, messageboxes, etc. Now it must be translated to different language's. Is there a way to do this fast? It should be great if everybody can translate the program without the sourcecode thus with a textfile or something.
Please give some ideas.
Thanks,
Willem
|
|
|
|
|
There are different way's to to that.
The first one is to store every (yes, i mean every) label in a database.
Before showing the label you must get it first from the database.
It's very easy now to add a language. You only need to add a field for that language in the database. And a translater can fill in the new field.
Your sourcecode remains the same. (no recompilations)
The other way is to add every label to the stringtable of the resource. You need to recompile when you added a language. But you don't need a database.
And the thirth way is the way I'll prefer for your project. Use a XML file with the labels for every language. It's not that hard to parse the XML-file.
None of the techniques above are quick and easy to implement.
You have to remove every label and get the label in the correct language
succes !
W.
|
|
|
|
|
whofmans wrote:
Is there a way to do this fast
Nope. AFAIK, a lot has already been discussed about this thema. There is several articles about that in CP, try to make a search.
~RaGE();
|
|
|
|
|
Another idea is to use a texte file of the following format:
01 "String1"
02 "String2"
03 "String3"
.... and so on for every string you need to be translated.
You create then a class that loads such a text file (you just have to specify the filename of the file to be loaded) and with a function that returns a string given an index (something like char* LanguageClass->GetString(int StringIndex) ).
So, for every string in your project, (for example MessageBox("String1") ), you specify instead: MessageBox(LanguageClass->GetString(1) ). For the controls (for the static textes, you must change the Id to a specific value), you use the SetWindowText function to change the text.
So, when you want to use another language you just have to specify another text file to be loaded. For example if you want to specify the language with the command line parameters, you construct your LanguageClass there and you specify wich language file has to be loaded.
Hope this helps !
|
|
|
|