|
Ya, but I didn't think it was implicit in the question that he had a recordset already.
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
|
|
|
|
|
Christian Graus wrote:
Ya, but I didn't think it was implicit in the question that he had a recordset already.
I know, I was just commenting on something that wasn't said yet in case someone wanted to use it in the future.
Nick Parker
May your glass be ever full.
May the roof over your head be always strong.
And may you be in heaven half an hour before the devil knows you’re dead. - Irish Blessing
|
|
|
|
|
You're right, of course. To be honest, I was aware that there was a property, but didn't mention it because I could not recall then name, and did not look it up because it did not seem to be exactly what was needed.
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
|
|
|
|
|
why "INT" and not "int" again?
thanks
norm
|
|
|
|
|
They are the same thing, but INT is a macro, presumably so one day Microsoft has the option to turn them all into longs or something. Personally I use the macros whenever I call a Microsoft API that uses them, otherwise I always use C++ standard types.
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
|
|
|
|
|
how can i display a save dialog with the same w2000 style, like explorer or notepad does? is there any function like GetFileNameFromBrowse. It looks easy and why not for save.
TCHAR szFile[_MAX_PATH]=_T("");
TCHAR *szFilters=_T("Files (*.fil)\0*.fil\0All\0*.*\0");
TCHAR *szTitle=_T("Open");
GetFileNameFromBrowse(GetSafeHwnd(),
szFile,
sizeof(szFile),
NULL,
NULL,
szFilters,
szTitle)
Thanks.
|
|
|
|
|
My app has 2 report-style list view controls with subitems:
http://igx89.digitalrice.com/wpicons.jpg[^]
I'm having problems with the subitems images centering, as you can see Here's the code I use to add the column:
Col.mask = LVCF_IMAGE | LVCF_SUBITEM | LVCF_FMT;
Col.iImage = IDI_ACTIVISM;<br />
Col.iSubItem = 1;<br />
Col.fmt = LVCFMT_IMAGE;<br />
PlayerListCtrl.InsertColumn(1,&Col);
and the code to add the subitems:
PlayerListCtrl.SetItem(nItem,1,LVIF_IMAGE,0,IDI_MODERATOR,0,0,i);
How can I make the subitem images centered? Thanks!
|
|
|
|
|
The alignment value only affects the text for the subitem, not the image. To center the image, you will have to use custom draw.
Software Zen: delete this;
|
|
|
|
|
Hey,
I have a fundamental problem.
When I close my (SDI)Application with a CustomToolbar (with an Combobox and CmageList), memoryleaks where detected by the compiler.
<br />
CImageList *pImageList = new CImageList();<br />
<br />
<br />
pImageList->Create(16,16,TRUE,4,4);<br />
...<br />
<br />
How can I solve this problem?
Errormessage:
Detected memory leaks!
Dumping objects ->
{87} client block at 0x00332910, subtype c0, 8 bytes long.
a CImageList object at $00332910, 8 bytes long
Object dump complete.
|
|
|
|
|
delete pImageList; ???
Seriously, you need to store this pointer, and call delete in your destructor. Of course, the leak is trivial ( it is cleaned up as soon as it happens, when the process ends ), but still it's nice to do it right.
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
|
|
|
|
|
When I call delete pImageList in my Class-Destructor nothing happend!
|
|
|
|
|
How do you mean, nothing happened ?
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
|
|
|
|
|
Ok, I solved my problem, thanx.
--> I create a member-variable in my Class (CImageList *m_pStorePointer) and store the pointer of the CImageList there (m_pStorePointer = pImageList).
In my class-destructor I call m_pStorePointer.DeleteImageList(). THIS WORKS!
But is it nessassary the create a seperat membervariable?
I tried to declare the pImageList variable as a membervariable and called in my function: pImageList = new CImageList(); So the Imagelist is stored in a membervariable. But when I Close my Application I get an exception in my destructor... WHY???
<br />
CMyHxToolbar::~CMyHxToolbar()<br />
{ pImageList->DeleteImageList();<br />
delete pImageList;<br />
<br />
}
|
|
|
|
|
AnTri wrote:
But when I Close my Application I get an exception in my destructor... WHY???
Because you're deleting the image list twice. You need to call pImageList->DeleteImageList(); and you might have to set pImageList to NULL , especially if you're going to re-use it, but you don't need to subsequently delete pImageList; .
-Alex
|
|
|
|
|
When I delete the line "delete pImageList..." the exception-error exists anyway.
<br />
CMyHxToolbar::~CMyHxToolbar()<br />
{<br />
pImageList->DeleteImageList();<br />
}<br />
|
|
|
|
|
Are you sure that the ImageList has not already been deleted at that point?
Have you stepped through with the debugger to find out which line is causing the exception?
What are the details of the exception? If it references memory at 0xC0000005 then it sounds like you're trying to access (possibly delete) something that doesn't exist, such as element i+1 of an array that is i long, or an ImageList.
Have you read up on CImageList::DeleteImageList() in MSDN to make sure you're using it the right way and doing all the things you should do.
Try adding pImageList->AssertValid() above pImageList->DeleteImageList() and running a debug build to make sure your pointer is valid.
Let us know how you get on.
-Alex
|
|
|
|
|
Hi y'all.
How can I change a control with another control, and how can I make an invisible control visible programmatically???
|
|
|
|
|
Change it how ?
ShowWindow(SW_SHOW);
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
|
|
|
|
|
What do you mean change one control with another control? Do you mean like when you click a button to disable a control? If yes, one solution is to add an event handle for the source control.
Kuphryn
|
|
|
|
|
Dennis L wrote:
how can I make an invisible control visible programmatically???
to hise/show
call your
control_Variable.ShowWindow(SW_HIDE);
control_Variable.ShowWindow(SW_SHOW);
Code the Dreams.
|
|
|
|
|
You can , for example, draw a CStatic (give it a real name, not the default one!) and get its CRect.
You can then Create() another Control (say, CEdit ) on top of it.
All the following is completely from head to keys. It probably does not compile:
test.h:
CTest : public CDialog
{
...
CStatic m_Placeholder;
CEdit m_Edit;
...
}
test.cpp:
...
void CTest::Overwrite_static()
{
CRect rect;
m_Placeholder.GetWindowRect(&rect);
m_Edit.Create(youreditstyle, rect, this, 1 )
}
...
This way your m_Edit sits directly on top of m_Placeholder.
I hope this was about what you intended.
--
"My opinions may have changed, but not the fact that I am right."
Found in the sig of Herbert Kaminski
|
|
|
|
|
In the Encapsulating Win32 Threads in C++ article on this website[1], I have downloaded the Demo code and loaded it into VC++ (manually, ie one file at a time). However I am getting the following error:
C:\temp\boserver\test\CMyThread.cpp(34) : error C2065: '_T' : undeclared identifier
I am wondering have I done something silly like not included a header file, or a library or something silly of the sort. Thank you for your time,
--Mark
[1] http://www.codeproject.com/threads/thread_win32.asp
|
|
|
|
|
_T (or _TEXT) is used to allow string literals to be compiled as either MBCS or UNICODE, and it is defined in tchar.h as something like:
#ifdef _UNICODE
#define _T(x) L##x
#else
#define _T(x) x
#endif
Dave
|
|
|
|
|
#include <tchar.h>
Michel
<i>It is a lovely language, but it takes a very long time to say anything in it, because we do not say anything in it, unless it is worth taking a very long time to say, and to listen to.</i>
<br> - TreeBeard
|
|
|
|
|
Is there any who can help???
I want a windowobject (works as an graph class) to have its own OnPaint call so that its not the mainframe thats have to make the OnPaint Call. In this way it will work much faster...
Please, I really want this help... Its for studying - Very important...
by the way im new at this CodeProject... it seems to be a cool site...
THANKS!!!!
HUSTLER!!!
|
|
|
|
|