|
There's a bug in Windows ListCtrl, (Report mode), using GRIDLINES.
When scrolling from right to left slowly, vertical lines are not drawn.
This happens because (aparentrly) the control draws the vertical lines whem drawing the subitems which are on the right of the line. When scrolling from right to left, there will be a moment when left subitems appears completely visible on the screen, but the left line wont be visible. If we scroll again to the left, this line wont be drawn (BUG) because these subitem don't require to be redrawn.
I Fix this bug by invalidating the rectangle where the left line should be when scrolling.
Is there a FIX to the ComCtl32.dll?
|
|
|
|
|
What's the difference between using CWnd::SubclassDlgItem and use DDX_Control? I've noticed that ClassWizard uses DDX_Control.
|
|
|
|
|
I have created a Tree Control using ActiveX, and have done my own drawing by overriding the CTreeCtrl::OnPaint. However, when I try to draw icons using the CDC::DrawIcon function, my icons always appears at 32x32.
I have created an icon resource which is 16x16, loaded it into a HICON variable using ::LoadImage in an overridden CTreeCtrl::PreCreateWindow function, and in my overridden CTreeCtrl::OnPaint called the function
memDC.DrawIcon( point, m_hIcon )
where memDC is a CDC object, point is a CPoint and m_hIcon is my HICON variable.
What appears is the correct icon, but it has been stretched horizontally and vertically by a factor of 2. How do I prevent this so my output icon is 16x16 ????
Thanks
Ant
|
|
|
|
|
Use DrawIconEx() instead - it has parameters where you specify the height/width of the icon.
--Mike--
http://home.inreach.com/mdunn/
"Didn't I tell you? I've got a brain the size of a planet."
--Marvin the paranoid android
|
|
|
|
|
I have a little problem in one of my programs. I want to use the scroll bars of a CView. How can I get pointers to them? I've tried CView::GetScrollBarCtrl(SB_VERT/HORZ), but it returns a NULL pointer.
I have added the line 'cs.style |= ( WS_HSCROLL | CS_VSCROLL );' in PreCreateWindow
Thanks very much in advance.
Erik
|
|
|
|
|
How can I create buttons with labels on a toolbar, like the Search, Favorites and History buttons on the Internet Explorer 5 toolbar?
|
|
|
|
|
|
I want to play a wav included in a resource dll file with a thousand of wav (98 Mb) in it. I use 'LoadResourceEx' but it doesnt works, can you help me.
Here's my code segment:
HINSTANCE m_hResource;
m_hResource = LoadLibraryEx("MyDll",NULL,LOAD_LIBRARY_AS_DATAFILE);
AfxSetResourceHandle(m_hResource);
HINSTANCE hInst = AfxGetResourceHandle( );
LPCSTR sound;
HANDLE hResource;
LPCTSTR nom("NameoftheWav");
hResource = LoadResource( hInst, FindResourceEx( hInst, "WAV", nom ,MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL))); /*WAV is the type defined in the .rc file */
sound = ( LPCSTR )LockResource( hResource );
sndPlaySound( sound, SND_NODEFAULT );
UnlockResource( hResource );
FreeResource( hResource );
FreeLibrary(m_hResource);
Thanks in advance.
Eric Tremblay
Multimedia Programmer,
QA-International
Quebec, Canada
|
|
|
|
|
I need to determine users rights to access files in NT, but I don't have their passwords to open their tokens.
Functions like AccessCheck() require the user token, which is obtained by LogonUser(), but it requires the user password.
I found a partial solution which is opening the file ACE list, and compare user and ACE SIDs, but if the ACE SID identifies a group, I've found no way to check it against the user SID.
Does anyone know how to do this?
|
|
|
|
|
i will be very thankfull if some helps me
i want to read the lpt port address from memory or any other way .
i know how to do that with c under dos
as follows
peekb(0,0x408);
this function returns a byte stored in the memory
of segment 0 offset 408
how can implement that with visual c++
i didn't find the same function here
thanks
|
|
|
|
|
BYTE byValue, *pbyAddr;
pbyAddr = (BYTE*) 0x408;
byValue = *pbyAddr;
--Mike--
http://home.inreach.com/mdunn/
"Didn't I tell you? I've got a brain the size of a planet."
--Marvin the paranoid android
|
|
|
|
|
Are you sure?
VC++ gives Access Violation error at line:
byValue = *pbyAddr;
As far as I know this is a very complicated task which requires device driver programming knowledge.
Suha
|
|
|
|
|
Inside an ActiveX control I have an array ( MFC's CPtrArray ) which hold structures of dates with notes.
1. What is the simplest way to save this data (and reload later for this control)?
2. If I'll decide to store such a data in Database, what is the simplest way to add the ADO support to my control?
Thanks.
|
|
|
|
|
I have developped an MDI Application that manages 2 types of documents.
So i use AddDocTemplate to register the 2 documents types.
The problem is that the main menu is displayed when starting application.
Then i click on 'New' button to create a document. Then i can select either the first or the second type
of document.
Then the menu disappear.
How can i set a menu for a document template ?
|
|
|
|
|
In your CWinApp derived class ( the one that ends in app ), override OnFileNew. Put this there:
// Force use of first template as it does not matter
POSITION POS = GetFirstDocTemplatePosition();
CDocTemplate* pTemp = GetNextDocTemplate(POS);
CGrausPaintDoc* pDoc = (CGrausPaintDoc*) pTemp->OpenDocumentFile(NULL);
Only, I presume you'll change the Document classname as appropriate.
Christian
The content of this post is not necessarily the opinion of my yadda yadda yadda.
To understand recursion, we must first understand recursion.
|
|
|
|
|
Hi, I need to create a 'Timer' function for my MIDI sequencer project. I've heard that the Windows timer is not too reliable, but I'm not experience enough to write something more solid on my own.
Ideally, the timer function could be implemented in the following way:
Timer Function definition
Parameters: x, y, z, a (function type, time value, function name, return result)
X (function): 1 - start
2 - stop
3 - reset to 0
4 - call z every y milliseconds
Y (time value) - a value range (long integer)
Z - name of a function to call
A - long integer return result (for reading time value)
Does anyone have any idea of how to help me with this? I'd be so grateful you wouldn't believe!!!
|
|
|
|
|
Although there is some criticism of OnTimer, there is a function called OnWindowsTimer or something, which measures time since Windows started and is, I am told, more reliable.
Christian
The content of this post is not necessarily the opinion of my yadda yadda yadda.
To understand recursion, we must first understand recursion.
|
|
|
|
|
Where do I find a list of what files to include in my installation when I use ODBC CRecordset interface to and Access DB file.
Happy programming!!
|
|
|
|
|
Where do I find a list of what files to include in my installation when I use ODBC CRecordset interface to and Access DB file.
Happy programming!!
|
|
|
|
|
i used a c code under dos to read LPT port address
using a function in dos.h
it was peekb(segment,offset)
as the following peekb(0x0,0x408);
how can i do it with visual c++?
thank you
|
|
|
|
|
Anybody know how to Play single note in MIDI???
Example "C" or "D7" etc.
Please help me.
|
|
|
|
|
First some music theory ;0)
D7 is NOT a single note, but rather a collection of four, namely D, F, A and C, with the D note lowest. Did you mean chords, or did you mean single notes and not understand this ?
Either way, DirectX8 integrates DirectMusic with DirectSound, so it will get MIDI up and running for you if you download the SDK from the Microsoft site. I'm sorry, I've not done it yet myself, I've just got through DDraw and DInput. DSound is next ;0)
Christian
The content of this post is not necessarily the opinion of my yadda yadda yadda.
To understand recursion, we must first understand recursion.
|
|
|
|
|
First of all - you don`t need directX to playback midi.
to play a midi note from an app you have to do the following things:
a) get a handle to midi-device ( start with MIDI-MAPPER - easier@beginning )
use: midiOutopen(...)
b) send a midi-note-on string by
use: midiOutShortMsg(...)
a note-on-command consists of 3 bytes
channel/note-on -> coded in 1. byte
note-number -> coded in 2. byte
note-velocity -> coded in 3. byte
c) send a midi-note-off-string
see b)
d) close midi-devices
use: midiOutClose(..)
For information see MSDN or http://www.harmony-central.com/MIDI/
Hope I forgot nothing important because i have written a midi-dll once and it works fine for years
Greating Mario
--------------------
www.klangwerker.de
rocknix@lycos.de
--------------------
|
|
|
|
|
Hi every body,
I have a project using MFC in a static library. If i compile it my exe size is 2500 ko in release mode. I heared it is possible to compile without symbols in order to decrease this size.
Can anybody say me how to do this ?
Best regards,
Cheickna
|
|
|
|
|
What you heard probably (though not necessarily) refers to compiling debug information into your release executable. This is normally turned off by default. Project->Settings->C/C++ ->Debug Info, select none.
What's giving you the large size is using the MFC static library. That is a big honking library. If you desperately need smaller size, use MFC as a DLL.
Hope this was on track.
|
|
|
|