|
Thank you, «_Superman_». I finally solve this problem. May I ask where do you get the answer? (read which book or see which web)
|
|
|
|
|
This was from personal experience
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
Super man, which function you tried?
|
|
|
|
|
Q1.I'm trying to write an MFC program in EVC++ 4.0 on window CE 5.0 that lists the disk drives on the system (C:, D:, and so on). I also need to know if the drive is a hard disk or a USB. Is there a class to get this information?
Q2. What are Windows Volume Management Functions in EVC++ 4.0 on window CE 5.0?
priyank
|
|
|
|
|
Hi,
I am using SHGetDataFromIDList to get CLSID of Recycler folder of D drive. But the below code is not giving CLSID except dwDescriptionID.
CLSID is coming garbage value like CCCCC.CCCC
where
lptvid->lpsfParent=Shell folder for D drive
lptvid->lpi=PIDL of Recycler folder
SHDESCRIPTIONID lpsf1;
if(SUCCEEDED(SHGetDataFromIDList(lptvid->lpsfParent,lptvid->lpi,SHGDFIL_DESCRIPTIONID,(LPVOID *)&lpsf1,sizeof(LPSHDESCRIPTIONID))))
{
cb=GetLastError();
if(lpsf1.clsid==CLSID_RecycleBin)
AfxMessageBox(_T("Matched"));
}
Where I am wrong?
|
|
|
|
|
Hello
I have a CRichEditCtrl class which displays contents on a CMDIChildWnd nad now I want to print on paper. Can I print without carrying my contents to CDC and only through CRichEditCtrl?
Prithaa
|
|
|
|
|
Don't think so - have a look at this article[^] - it's got all hte rich-edit printing code you could want
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
I would like to add a graph (x vs y plot ) to my application. I would like this graph to be displayed in a new window. Therefore, I wrote the following code:
<br />
void<br />
CMyView::drawGraph()<br />
{<br />
<br />
CRect rect1( 100, 200, 300, 400 );<br />
CreateEx( 0, NULL, TEXT("Graph"), WS_OVERLAPPEDWINDOW|WS_CHILD,<br />
rect1, this, 0 );<br />
}<br />
<br />
Unfortunately, the call to CWnd::CreateEx dies with an assertion error. The routine CWnd::CreateEx<br />
calls the routine AfxHookWindowCreate. This routine has the following assert statement in it:<br />
<code><br />
ASSERT(pWnd->m_hWnd == NULL);
In my case, m_hWnd is non-NULL. Therefore, the program aborts. I am sure that I am doing something
wrong in the call to CreateEx but I do not know what it is. Also, I find the documentation for
this call to be lacking. For one thing, I could not find any examples where it was used to create
a sub-window.
Thanks
Bob
|
|
|
|
|
BobInNJ wrote: CRect rect1( 100, 200, 300, 400 );
CreateEx( 0, NULL, TEXT("Graph"), WS_OVERLAPPEDWINDOW|WS_CHILD,
rect1, this, 0 );
Effectively, here you are trying to create CMyView again, where it already exists.
You may want to do something like this
CRect rect1( 100, 200, 300, 400 );
m_wndYouwantotCreate.CreateEx( 0, NULL, TEXT("Graph"), WS_OVERLAPPEDWINDOW|WS_CHILD,
rect1, this, 0 );
|
|
|
|
|
You can create another window from your view, but it will be a bit complex.
I can think of a couple of choices for you...
The simplest one is to create a new CDialog based class, that only has one control in it. You can find plenty of graph controls here on codeproject that you can pop in this dialog. Then just call DoModal on it, let it stay up until the user presses OK, and all is nice.
The other is a bit more complex. You could make a window like a popup control with your little graph on it, that goes away when the user moves the mouse again. This depends on how you want your software to be. Have a look at:
http://www.dilascia.com/PixieDoc.htm#CPopupText[^]
for a tooltip alike window - just change the drawing code / size to your desires.
Iain.
Codeproject MVP for C++, I can't believe it's for my lounge posts...
|
|
|
|
|
Hi,
By default, when using Ctrl+Tab or the Window menu to switch between windows in a standard MDI app, it leaves the window list in its current order. The behaviour in Visual Studio (ignoring the popup which lists the windows) always puts the current window at the top of the list of windows. This then allows easy toggling between two top windows using Ctrl+Tab, as the previous window is then made the second in the list, so you don't have to cycle through all the open windows to get back to the one you started from.
I am trying to replicate the VS behaviour in an MFC MDI app, but can't find a way of re-ordering the window list. Has anyone else managed to do this?
Paul.
"The way of a fool seems right to him, but a wise man listens to advice" - Proverbs 12:15 (NIV)
|
|
|
|
|
Paul S. Vickery wrote: but can't find a way of re-ordering the window list
I am not sure if you can change menu item positions, I have never tried to do it. If it is not supported perhaps you could manage the lists order in a more appropriate memory structure and just change the menu item text and which item it references in the structure.
|
|
|
|
|
Context is C++, Visual C6
My application has to interface with two types of peripherals, with the same services :
For exemple, the service is :
void SetOutput( index, level) and
So my application do :
void MyApplicationFunc()
{
classPeripheral *p = new classPeripheral();
p->SetOutput( 0, 1);
}
I want to code TWO DLL in C++, with the same class interface, but driving two diffrents kind of peripherals.
For exemple
class cPeripheral
{
public :
cPeripheral();
void SetOutput( int Index, bool Level);
};
But each implementation have differents internal functions and variables in order to drive the specific peripheral.
So I want to have a good quality of code (no cast or void pointer), a good dependency resolution between the differents .dsp, and the possibility to change one DLL (DLL peripheral 1) by the other (DLL peripheral 2) with a perfect consistancy of dynamic link between application and class services.
Can you give me a simple workspace sample, with the differents projects (.dsp) (Application, peripheral 1, peripheral 2), showing the architecture , definition and inter-dependencies between the differents classes.
Best regards.
|
|
|
|
|
You might find one of these design patterns [^] useful.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
marcelcerdanjunior wrote: Can you give me a simple workspace sample, with the differents projects (.dsp) (Application, peripheral 1, peripheral 2), showing the architecture , definition and inter-dependencies between the differents classes.
Do I have to provide the spoon too?
More seriously, I do exactly what you're talking about - I have plugin DLLs which manage different motion control architectures through a common interface. I don't actually use COM for this, as I'm not that bothered about other people controlling my machines, but I do use their philosophy.
I have a pure virtual class, and the implementations inherit from this. So far, just like "interface" keyword.
I have a registry key with the name of the implementation DLL. I load that, and call a named function to export a pointer to a control object. That pointer is of the virtual base class type. All other parts of the software only know about that base class.
There are some good starter articles on COM on this site if you want further inspiration.
Good luck,
Iain.
Codeproject MVP for C++, I can't believe it's for my lounge posts...
|
|
|
|
|
Nice post but you didn't explain what the spoon is for.
Oh, if it involves his hind parts I don't want to know.
|
|
|
|
|
HI! help, please, me.
MFC, Visual C++ STUDIO 2008
I want to place string into ComboBox that
Is on modeless dialog window.
I’m using two classes:
class CAdodc_my : public Cdialog
class CMyModeless2 : public Cdialog
CMyModeless2* m_pModeless;
CComboBox m_cComboBoxModeless;
BOOL CAdodc_my::OnInitDialog()
{
m_pModeless = new CMyModeless2( this);
m_pModeless->m_cComboBoxModeless.AddString("SPARTAC");
}
Debug Assertion Failed!
Program: ...Tested_Examples_Studio_2008\ADOMy_first\Debug\ADOMy_first.exe
File: f:\dd\vctools\vc7libs\ship\atlmfc\include\afxwin2.inl
Line: 879
For information on how your program can cause an assertion
failure, see the Visual C++ documentation on asserts.
(Press Retry to debug the application)
|
|
|
|
|
At the time you try to AddString, you have not yet created the dialog, so the ComboBox doesn't exist yet.
After you create the instance with new, you need to call Create to actually create the windows.
Hope that helps.
Karl - WK5M
PP-ASEL-IA (N43CS)
PGP Key: 0xDB02E193
PGP Key Fingerprint: 8F06 5A2E 2735 892B 821C 871A 0411 94EA DB02 E193
|
|
|
|
|
is m_cComboBoxModelessinitialized/created?
You need to google first, if you have "It's urgent please" mentioned in your question.
_AnShUmAn_
|
|
|
|
|
CHIVOTIOV wrote: m_pModeless->m_cComboBoxModeless.AddString("SPARTAC");
Do this in CMyModeless2::OnInitDialog() .
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
I have string data for a dialog. However when i click on the a button i want this string data to be displayed on the second dialog.
Please let me know how to achieve this...
Thanks in advance
|
|
|
|
|
|
I think the link to that tox's article should be permanently added to the forum page.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Yep, it's a shame it is so under-rated...
|
|
|
|
|
Yes. I think the article for beginners are the most valuable here at CP.
Unfortunately, such articles are often downvoted by the 'very-smart-super-expert' people who enjoys themselves just with the 'most-advanced-innovative-stuff' (not to mention the 'trollistic-coward-univoter' CP plague).
I suppose there is also something personal against tox, since he is a bit 'touchy', no need to say that if you downvote an article beacuse you dislike the author then you're definitely a pathological idiot.
It's frustrating form me, having to say, each time: "Trust me, it scored bad, but is actually a very good article".
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|