|
Hi, how can I avoid that a scrollbar inside my listbox vanishes?
I created a listbox with styles LBS_DISABLENOSCROLL | WS_VSCROLL . But when I resize the listbox so small that the scrollbar is the only visible part, the scrollbar disappears. Thanks for help.
|
|
|
|
|
How can I extract an Icon in C++ from an .exe file?
Do anyone have an Samplecode?
|
|
|
|
|
::ExtractIcon()
Read MSDN Library for more information. It's the best way to learn if you look up things by your own!
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++!
|
|
|
|
|
|
I have some ideas of developing applications on Microsoft Excel, but most materials I could found were base on VB. Where can I begin with?
|
|
|
|
|
|
I wrote some math routines in C and compiled it to a dll file that can be called from Excel either with the CALL function or a VBA wrapper. I can post an example later if that is what you are looking for.
If you are looking to manipulate Excel formating and such, then I can't help.
I do have a book called MS Excel Developers Guide, somewhere? It explains some of that stuff.
|
|
|
|
|
hi there
i need some ideas about putting treeview controls inside listview
more specific i need to have a treeview in each listview item or subitem
i found an article about treelistview but this implement subitems facility for treeview item and is not usefull for me
thanks in advance for your help
|
|
|
|
|
Anyone knows how to write to the parallel port in c++ ?
I am using windows 2000/NT
Thanks
Shay Harel
|
|
|
|
|
look in MSDN for CreateFile API function
|
|
|
|
|
In Codeproject are some articles about (Serial Port) it.
You MUST use overlapped I/O -> it is not quick hack and not easy. Prepare yourself for work.
Try this @ home. (B&B)
|
|
|
|
|
Hello, how can I create a transparent Icon (not white...) or Bitmap to place on a CButton object.
I use the .net IDE!
|
|
|
|
|
I used CButtonST class here from CP.
|
|
|
|
|
The mouse cursor doesn't change over a window I created!
(If I put the cursor over the edge, so I see the "size" cursor, it stays that way when I move it over the window)
Window creation:
if (!m_wndTileset.CreateEx(WS_EX_PALETTEWINDOW | WS_EX_TOOLWINDOW | WS_EX_TOPMOST,
AfxRegisterWndClass(CS_VREDRAW | CS_HREDRAW, theApp.LoadCursor(IDC_ARROW)),
"Tileset", WS_SIZEBOX | WS_SYSMENU, CRect(), this, 0))
Any ideas? Do I have to do soemthing special to make it change?
|
|
|
|
|
Override OnSetCursor (MFC) or handle WM_SETCURSOR (Win32) ?
~RaGE();
|
|
|
|
|
From MSDN:
The default implementation sets the cursor to an arrow if it is not in the client area or to the registered-class cursor if it is.
So it should already work???
|
|
|
|
|
Hi,
I've created a project with the ATL Com Appwizard and inserted a new ATL object, derived from ComboBox. It uses an internal variable m_ctlComboBox which is of type CContainedWindow . I want to be able to invoke methods like InsertString and the likes from VB without programming stubs for them, since the implementation is already done by ComboBox itself. How can I publish the internally used control so VB sees these methods and properties?
I've now replaced the type of m_ctlComboBox from CContainedWindow to CContainedWindowT<CComboBoxT<CWindow> > deriving from a template defined in ATLControls.h. I just thought it might help, but no such luck....
|
|
|
|
|
i want to pass two strings from vb to a dll written in vc++.
downlaodfile(char *str1,char *str2)
{
}
is the parameter declaration is correct.Is we have to free any memory after the function ends.Any error pl reply
|
|
|
|
|
Because the char * are being passed into the function, I would expect the function that passes them in to take responsibility for cleaning them up. Is VB capable of producing char *'s ? Personally, I'd pass in std::strings, because then I'd know they were being cleaned up.
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002
|
|
|
|
|
I would suggest that you use BSTR instead of char* . Assuming both parameters are [in] parameters then you don't have to worry about the memory these strings occupy. If however you are returning something in one of this parameter then you must use an allocation scheme VB understands.
I would suggest you create a simple COM object and define this function in it. COM defines wery well all issues regarding string manipulation. You would also definitely use BSTR there.
And PLEASE use more descriptive variable names than str1 and str2. What do these parameters do? There's absolutely no way to tell.
Wenn ist das Nunstück git und Slotermeyer? Ja! Beierhund das oder die Flipperwaldt gersput!
|
|
|
|
|
dabs wrote:
And PLEASE use more descriptive variable names than str1 and str2. What do these parameters do? There's absolutely no way to tell.
I've always thought we should create a Code Review forum, where we can post code to be reviewed by our peers.
Michael
Fat bottomed girls
You make the rockin' world go round -- Queen
|
|
|
|
|
I have a class derived from CListView and a list ctrl (report style) derived from CListCtrl lying beneath. When clicking a list item with the right mouse button, I'd like to change the color of the text. This is done in CMyListCtrl::DrawItem - no problem... When moving the mouse while holding the right mouse button, several items' colors may be changed (redrawn). This is where I have problems: Everytime a new item's color is changed, the whole control is redrawn causing flickering. I want to get rid of this flickering. Double buffering is suggested to be used in CMyListView::OnDraw(), but I have no possibility of drawing the particular item in this function. Do you have any suggestions?
Christoffer Andreas Andersen
"I'm just here to regulate the funkyness!" - Gandolfini
|
|
|
|
|
Hi - it's me again. I kinda solved this myself. A silly question really. The problem had nothing to do with what I thought it had. All I needed to do in order to solve this problem was to use InvalidateRect() instead of RedrawWindow() Probably a newbie mistake. Won't happen again - I hope.
Christoffer Andreas Andersen
"I'm just here to regulate the funkyness!" - Gandolfini
|
|
|
|
|
Beware that InvalidateRect() just marks the rectangle as to be redrawn, but doesn't generate the repaintin.
From MSDN: "If you do not want the application to wait until the application's message queue has no other messages, use the UpdateWindow function to force the WM_PAINT message to be sent immediately"
So if your application processes other messages, your element could be not redrawn.
Even with ListCtrl, double buffering is useful to avoid flickering, when resizing the list for example.
A way to do so is, keeping the actual code you have to draw your elements:
void CListCtrlEx::OnPaint() <br />
{<br />
CPaintDC dc(this);
CRect cClipRect;<br />
<br />
if(dc.GetClipBox(&cClipRect) == NULLREGION)<br />
return;<br />
<br />
int top = 0;<br />
CRect cRectBounds, cRectHeader, cRectClient;<br />
<br />
CHeaderCtrl* pHeader = (CHeaderCtrl*)GetDlgItem(0);<br />
pHeader->GetClientRect(&cRectHeader); <br />
CRect cInterRect;<br />
<br />
cInterRect.IntersectRect(cRectHeader, cClipRect);<br />
top = cRectHeader.bottom;<br />
<br />
cClipRect.top = max(cClipRect.top, top);<br />
CMemoryDC pDC(&dc, cClipRect, top);<br />
pDC->FillSolidRect(cClipRect, ::GetSysColor(COLOR_WINDOW));<br />
<br />
DefWindowProc(WM_PAINT, (WPARAM) pDC->GetSafeHdc(), 0);<br />
}
// CMemoryDC is my implementation derived from this article[^]
HTH,
Ohé Partisans, Ouvriers et Paysans
C'est l'alarme!
Le Chant des Partisans
|
|
|
|
|
Hi:
I have written an activex control used for iamge display. The image data is come from a network channel.
I call these functions : DrawDibOpen, DrawDibReset, DrawDibDraw, DrawDibClose by sequence. When the network channel is opened, the DrawDibdraw will be used to draw the image data received from the network channel.
When I open/close this channel for several times ( which means the DrawDibOpen, DrawDibReset, DrawDibClose will be called for several times accordingly ), I found that the DrawDibDraw doesn't work any more. The channel still can receive data, but DrawDibDraw will always return FALSE.
Anyone could help me to solve this question? Thank you!
Luo C.H.
|
|
|
|