|
You have to move the statement UpdateData(TRUE); outside the for loop. The value of the variable m_E20 is not updated when you come to the for loop. So the loop does not get executed.
So the correct way is
UpdateData(TRUE);
for(int k=0; k < m_E20; k++)
{<br />
m_strET="";
-----<br />
}<br />
UpdateData(FALSE);
|
|
|
|
|
Hi,
I want to use ST_SplitterWnd (http://www.codeproject.com/splitter/st_splitterwnd.asp). The right pane should be a CFrameWnd with a DialogBar and some views. Attached to the Dialog Bar is a CTabCtrl for switching between the views in the CFrameWnd. The problem now is, that a small part of one of the views is visible within the first view at the left upper corner.
When showing the other views (by clicking at the appropriate tab) and then going to the first view again, the problem is gone.
When I use a standard CSplitterWnd I don't have this effect.
What's wrong?
Thank's
#9370
-- modified at 7:41 Sunday 13th November, 2005
|
|
|
|
|
Off-hand, it sounds like an initial background painting problem.
You would probably be better off posting a message in the article's forum, since it sounds like a problem related to the article code.
Software Zen: delete this;
|
|
|
|
|
Hi Gary,
thank you for your reply but I already tried it in the article's forum - I got no answer yet.
#9370
|
|
|
|
|
Hi!!!
I'm an italian studentand I'm implementing an OPC XML DA Client using managed C++.
In the Write primitive, for each item I have to set the ItemValue as an istance of the Object class, like the OPC specification requires.
By Client interface I obtain a String. I have tried to obtain an Object by casting, but the response of the OPCserver was "E_BADTYPE", cause the OPCServer see a String*, not an Object*.
What can I do to obtain an Object (acceptable by OPCServer) from a String?
Maybe this is a stupid question, but I'm a beginner in the OPC World.
Thanks a lot.
Ninni Crisafi
|
|
|
|
|
I am new to using Bitmaps in my programs... As tutorial/practice I want to create a simple game, the graphics of which will be supplied by bitmaps, however loading and blitting the individual bitmaps to the window DC provides much flicker. I realize I need to implement some double buffering strategy, however, I am, as yet unable to do so.
The way I see it:
1. Create two compatible DCs. (intermediate and final)
2. Load and select the individual bitmaps to the intermediate DC.
3. BitBlt() then ecah to their proper position in the "final" DC
4. Load and select the "final" bitmap (the final DC) into the window DC
5. BitBlt() this resultant image to the screen.
I am assuming there is something I do not understand about the process, or step four above, specifically. I am unsure what.
The code:
BITMAP bm;
PAINTSTRUCT ps;
HDC hdc = BeginPaint(hwnd, &ps);
HBITMAP hbmOld;
HDC hdcMem = CreateCompatibleDC(hdc);
HDC hdcFinal = CreateCompatibleDC(hdcMem);
int loopX, loopY;
for (loopX = 0; loopX < 20; loopX++) {
for (loopY =0; loopY < 20; loopY++) {
hbmOld = (HBITMAP)SelectObject(hdcMem, LoadBitmap(GetModuleHandle(NULL), MAKEINTRESOURCE(map.getMap(loopX, loopY))));
GetObject(LoadBitmap(GetModuleHandle(NULL), MAKEINTRESOURCE(map.getMap(loopX, loopY))), sizeof(bm), &bm);
BitBlt(hdcFinal, loopX * 32, loopY * 32, bm.bmWidth, bm.bmHeight, hdcMem, 0, 0, SRCCOPY);
}
}
hbmOld = (HBITMAP)SelectObject(hdcFinal, CreateCompatibleBitmap(hdcMem, 640, 640));
GetObject(CreateCompatibleBitmap(hdcMem, 640, 640), sizeof(bm), &bm);
BitBlt(hdc, 0, 0, bm.bmWidth, bm.bmHeight, hdcFinal, 0, 0, SRCCOPY);
SelectObject(hdcFinal, hbmOld);
SelectObject(hdcMem, hbmOld);
ReleaseDC(hwnd, hdcFinal);
ReleaseDC(hwnd, hdcMem);
EndPaint(hwnd, &ps);
|
|
|
|
|
Here's an old example that talks about eliminating flicker:
Flicker-Free Displays Using an Off-Screen DC
I would just try to get a flicker free example working using a simple color fill first. (use FillRect) Once you've got that down, replace the FillRect code with the code that draws your bitmaps.
"When you know you're going to eat crow, it's best to eat it while it's still warm." - Reader's Digest
|
|
|
|
|
Akilez wrote: HDC hdcFinal = CreateCompatibleDC(hdcMem);
Change hdcMem to hdc there - both mem DCs have to be compatible with the DC that's connected to the screen.
--Mike--
Visual C++ MVP
LINKS~! Ericahist | 1ClickPicGrabber | NEW~! CP SearchBar v3.0 | C++ Forum FAQ
"Just because the box has 2 gigabytes of memory doesn't mean you get to use it all!"
-- Rico Mariani, CLR perf guy
|
|
|
|
|
I want to access the basic port by using this
simple functions _inp and _outp which are used
in the TurboC compilers or say compilers for DOS.
In windows i tried to use them in my MFC programe
but there are Runtime errrors stating Unprivilaged
instruction .
I also tried to use the assmebly code for the same
but the same error is disaplayed .
can anyone suggest me any other option for this
thankin you
vikas
Vikas Amin
Embin Technology
Bombay
vikas.amin@embin.com
|
|
|
|
|
I am afraid you are out of luck in the Windows world. Input and output instructions are privileged, which means that only device drivers are allowed to use them. The purpose of this is to protect system integrity and to let the operating system arbitrate access to the hardware, which is considered a shared resource.
If you are trying to control a specific piece of hardware, you should contact the manufacturer to see if they provide a Windows driver and interface software that you can use.
Software Zen: delete this;
|
|
|
|
|
You will need to create a miniport driver (.sys) that can map that memory and access that I/O. After that you can create a macro that uses the inp/outp syntax to call the miniport. See MSDN for more info on miniports.
|
|
|
|
|
vikas amin wrote: I want to access the basic port by using this
simple functions _inp and _outp which are used
in the TurboC compilers or say compilers for DOS.
What about simple Api like ReadFile and WriteFile
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
I have used the IO library you can find at http://www.logix4u.net/inpout32.htm[^]
This allows your code to run on Windows 9x or XP. Works nicely!
As I recall, the documentation is a bit poor, for example, it is not clear that the input and output calls are 8-bit. (This may have been fixed by now.)
|
|
|
|
|
any help on how to manage the code in VC++
Vikas Amin
Embin Technology
Bombay
vikas.amin@embin.com
|
|
|
|
|
What do you mean by the term "manage"?
Software Zen: delete this;
|
|
|
|
|
vikas amin wrote: any help on how to manage the code in VC++
What about Visual Source Safe or CVS
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
I am trying to activate a vertical scroll bar in a CGridCellRich control embedded in Chris Monder's CGridCtrl control. My use of ES_MULTILINE in the call to Create has the desired effect, but setting the WS_VSCROLL bit does not produce scrollbars.
m_RichEditTemp.Create ( WS_CHILD | ES_MULTILINE | WS_VSCROLL, CRect(0,0,0,0), this, IDC_RICHEDIT_TEMP);
Also, I tried calling ShowScrollBar from the control itself, but this has no appearent effect. Any suggestions would be appreciated.
Thanks,
Gil
|
|
|
|
|
hey guys,i am currently working on the media player project,
i am want have feature like capture the cd track by using directshow
and convert the track to mp3 into the harddrive
is it possiable by using Da Directshow?
thanks
|
|
|
|
|
If you have an MP3 encoder filter loaded the it should not be a problem.
|
|
|
|
|
I'm trying to design a special type of grid in VS .NET 2003. I need to create a row of rectangular boxes, each one the same height but possibly differing lengths. I will also need to create a series of these things fashioned like a grid.
I was thinking a list view but I don't think you can change individual cell lengths. I don't quite know what would work and I was thinking I'd have to make it myself somehow. If I made it myself, I'd probably derive my class from CView because it would be a view in a document interface-type application.
|
|
|
|
|
As far as i think its more of Custom Design so
u will have to make it your self ?
best luck
Vikas Amin
Embin Technology
Bombay
vikas.amin@embin.com
|
|
|
|
|
|
Yeah, I ran across that one among other spreadsheet-style controls. I want to show more than just a single text item in a single cell. I found an article on here that describes how to create your own control and I'm trying to work through it now.
|
|
|
|
|
Hi,
I created a SDI project with a few dialogs
One of the dialogs is to allow user to open
up a file, then the program will parse the data.
After that, it will display some text data
to the user.
I did some search on display text but I
am sure what's the best approach.
Can or should I use a CDialog to display text?
The text is going to be a couple hundred lines
and some lines are about 90 characters long.
So, I probably need to have vertical &
horizontal scroll bars.
Any suggestions would be appreciated!
Thanks,
Kevin
|
|
|
|
|
An edit control in a dialog would do nicely. You can enable several styles that help: "multiline", "want return", and "horizontal scroll" and "vertical scroll". You can set these in the resource editor when you create the control.
If the text is formatted using spaces (say, into columns), you may want to set the font used in the edit control to a monospaced font (Courier New, for example).
Software Zen: delete this;
|
|
|
|