|
Thanks!
I have one question.
In the line:
// CString myString;
CEditCtrl::GetLine(1, myString.GetBuffer(255), 255);
Is 255 the maximun number of characters in *that line*?
I would like to get everything on that line.
In general, is the size (255 in this case) referring to bytes or characters (characters * bytes = maxsize?).
Kuphryn
|
|
|
|
|
Hi
Is there any class or template like CArray not written in c++?
I used CArray, but now I need to write an app without MFC support.
If there exists some subtitute for CArray, could you please explain how to use it?`
Thanks in advance
modified 12-Sep-18 21:01pm.
|
|
|
|
|
I think STL will help you. CArray is not the best analog of stl.
And I don anderstand what you mean Gregor S. wrote:
not written in c++?
|
|
|
|
|
Thanks!
My fault, I meant "not written in MFC".
Could you give me a link or tutorial that explains how to use the STL? I never used it before
modified 12-Sep-18 21:01pm.
|
|
|
|
|
There some articles here
http://www.codeproject.com/vcpp/stl/
It is not very difficult to use STL. It has look nearly as MFC Classes such as CArray
|
|
|
|
|
CArray was written as a substitute for vector while waiting for the C++ standard. Here is a link to the first of my STL articles, which covers vector. You'll find the STL is far superior to CArray.
Christian
The tragedy of cyberspace - that so much can travel so far, and yet mean so little.
"I'm somewhat suspicious of STL though. My (test,experimental) program worked first time. Whats that all about??!?!
- Jon Hulatt, 22/3/2002
|
|
|
|
|
Christian Graus wrote:
Here is a link to the first of my STL articles, which covers vector
uhhhh where is the link?
Nish
One little CD gone,
Then two CDs gone,
Then 5 more gone,
For a total 7 gones,
If I was a CD R,
I'd wanna cry,
Cause I'd be just a goner,
For a nasty CD burner.
[funny how frustration wakes up the poet in me]
|
|
|
|
|
I dunno - I posted it.
Christian
The tragedy of cyberspace - that so much can travel so far, and yet mean so little.
"I'm somewhat suspicious of STL though. My (test,experimental) program worked first time. Whats that all about??!?!
- Jon Hulatt, 22/3/2002
|
|
|
|
|
Christian Graus wrote:
I dunno - I posted it.
Huh? You mean an entire a-href vanished???
Nish
One little CD gone,
Then two CDs gone,
Then 5 more gone,
For a total 7 gones,
If I was a CD R,
I'd wanna cry,
Cause I'd be just a goner,
For a nasty CD burner.
[funny how frustration wakes up the poet in me]
|
|
|
|
|
Well, I typed it in, so I guess so. It probably got typed in wrong, so it's in the page but has not translated to a link.
Christian
The tragedy of cyberspace - that so much can travel so far, and yet mean so little.
"I'm somewhat suspicious of STL though. My (test,experimental) program worked first time. Whats that all about??!?!
- Jon Hulatt, 22/3/2002
|
|
|
|
|
Hi there,
I have question about using of an Activex which called Microsoft Coolbar control 6.0
One of a functions in this activex is about setting an image list ...
[ccode]
m_Coolbar.SetRefImageList(LPDISPATCH newValue);
[/ccode]
I can make an image list by CImageList class, but how can i use it in SetRefImageList function ?
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
Does anyone know how (if it is possible) to change the client rectangle of a common control (ListBox, EditBox ... etc)? The reason I ask is because I created a skinable scrollbar class and want to add it into the non-client area of an edit box or list box. My thinking is that if I could shrink the client area I could create my new scrollbar window in the non-client space, which would not be painted over.
Any help would be greatly appreciated
|
|
|
|
|
handle the WM_NCCALCSIZE message. Have a look at my article at http://www.codeproject.com/editctrl/fileeditctrl.asp where I used this method to embed a button in an edit control.
HTH
---
CPUA 0x5041
Sonork 100.11743 Chicken Little
It may be that your sole purpose in life is simply to serve as a warning to others.
|
|
|
|
|
Thanks a lot, that did the job. Great article too
|
|
|
|
|
My MenuBar class use the HMENU ant the ::TrackPopupMenu, the problem is not with the HMENU command, is with the ::TrackPopupMenu, i'm writing my own menu class, but this is not a menu, is a window that acts as a menu, and when i use the ::TrackPopupMenu, i get the classic menu made by Windows, how can i make that the ::TrackPopupMenu shows my menu(fakemenu)?.
|
|
|
|
|
I am trying to create a borderless window that will just be display text of statis and will close by itself if statis is positive. The window will only display buttons to handle error and will have another chance to close app. And no taskbar button.
I have VS.NET but using VC++ 6.0 code(Win32API only). I have tried calling CreateWindow() with many different window styles but some work but not like I wanted and others build stops at the end of building and doesn't switch over to debug mode.
Note: if the backgroud was white and I was to run it windows should only paint white over the current screen.
Any help.
Real World Coding:
POP& BuyAPop(Money ADollar){...};
|
|
|
|
|
Omit the border styles (WS_BORDER, WS_THICKFRAME, etc.) and add the extended style WS_EX_TOOLWINDOW.
--Mike--
Actual sign at the laundromat I go to: "No tinting or dying"
Like the Google toolbar? Then check out UltraBar, with more features & customizable search engines!
My really out-of-date homepage
Big fan of Alyson Hannigan and Jamie Salé.
|
|
|
|
|
Thank for reply...
Your reply help up to here...
I changed the style param for CreateWindow() to 0.
I added SetWindowLong(...,GWL_STYLE, 0);
and SetWindowLong(...,GWL_EXSTYLE, 0);
All that has change is I can drag window, curved ends XP titlebar and all borders are gone are gone(or transparent). The only thing is left is the titlebar is still painted and when Debuging and VS.NET is maximized and program is below it
Two thing I can do...
1) I DbClick VS.NET caption and some of my program show but VS.NET UI is not erase from non-client area.
2) I click my program taskbar button and only the client area of appears on top(non-client area seems transparent). This is what I wanted along.
Also I still cant get rid of that taskbar button.
Any more help...
Thanks...
Real World Coding:
POP& BuyAPop(Money ADollar){...};
|
|
|
|
|
Would it be easier to create a hidden parent window and just have the child borderless window display.
Real World Coding:
POP& BuyAPop(Money ADollar){...};
|
|
|
|
|
Use ModifyStyle(..)
Or ModifyStyleEx(..) to change the window style.
Regards
http://www.ucancode.net/
|
|
|
|
|
I'm trying to post a meesage from one class to another, passing a CString value with the message. Currrently, I casting the CString into a LPARAM and passing that. Then in the function that receives the meesage, I'm casting the LPARAM into an LPCTSTR/CString.
The LPARAM value is passed across correctly, but when I recast back to the LPCTSTR, the data is garbage.
Any ideas on what I'm doing wrong?
// posting function
CString myStr = _T("some data");
LPARAM lParam = (LPARAM)myStr;
::PostMessage(HWND_BROADCAST, WMU_MY_MSG, 0, lParam);
// receiving function
LPCTSTR lp = (LPCTSTR)lParam;
lp holds garbage data.
Thanks!
|
|
|
|
|
Is the class that you are sending the CString to in a different process? Memory is not valid across process boundaries, you will need to allocate memory using the GlobalAlloc function, then copy the data from the CString into your new buffer.
If this is not the case, could you give more details as to why you are using HWND_BROADCAST.
Good Luck
Checkout my Guide to Win32 Paint for Intermediates
|
|
|
|
|
Not in a different process, as far as i know.
Using HWND_BROADCAST because...uhh.... why AM i using it? I'm not sure, i think it's because it worked when i was playing around with different values.
I'll try the GlobalAlloc anyways.
Thanks!
|
|
|
|
|
I just noticed something that I think is your problem. You are creating a CString on the stack inside of a function, then you are posting a message. The function call that all of this is happening in will exit before the posted message gets handled. When the function call exits, it destroys all of the variables that were created on the stack for that function.
There are three ways to solve this:
1) Make your CString a global variable.
2) Dynamically allocate the CString class, and delete it at a later time (this could get messy though, deciding who should actually delete the string, it should not be deleted until the posted message is handled.
3) Use SendMessage instead of PostMessage. SendMessage happens instantly, and does not return until the message is handled by your target window.
Good Luck
Checkout my Guide to Win32 Paint for Intermediates
|
|
|
|
|
Heh, yeah, silly me. I noticed the same error, then smacked myself on the head a few times because it's so simple, yet i couldn't get it to work. Yeah, i think i need more sleep
Thanks for all your help too.
|
|
|
|