|
Anu_Bala wrote: static void OnCallClick(CString msg)
{
}
static void OnCallClick(System::String^ msg)<br />
{<br />
}
Its only a guess... please try ; I think the reason is already said by Maxwell.
|
|
|
|
|
Its working.Thank u so much.
But i cannot enter any text in that.Actually in Combobox,IsEditable is TRUE.
But i cannot enter anything.But this event is working fine.
Anu
|
|
|
|
|
It seems the delegate expects an argument of type String^ and your function is using CString as argument.
|
|
|
|
|
Hi, I am learning C++ right now and I am analysing some VS2008 example of MFC. But I think it's not important in this case.
"modeldlg.h"
class CMainDlg
{
CAdderDialog* m_pModeless;
}
What I want to ask is, if it is possible to omit forward declaration of CAdderDialog, because it is not present in "modeldlg.h" and somehow it compiles OK. When I try to make the same code on my own, it doesn't compile.
|
|
|
|
|
You will definitely need a forward declaration of the CAdderDialog class since you're creating a pointer of that type.
If you where creating an object of this type you would need to include the entire class definition.
|
|
|
|
|
Yes, I think so too. But as I have written it is compiling. Do You have any explanantion why ? Maybe it is some project property ?
Complete file modeldlg.h
class CMainDlg : public CDialog
{
public:
CMainDlg(CWnd* pParent = NULL);
void BoxDone();
enum { IDD = IDD_MAIN_DIALOG };
protected:
virtual void DoDataExchange(CDataExchange* pDX);
protected:
HICON m_hIcon;
<big>CAdderDialog* m_pModeless;</big>
virtual BOOL OnInitDialog();
afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
afx_msg void OnPaint();
afx_msg HCURSOR OnQueryDragIcon();
virtual void OnOK();
DECLARE_MESSAGE_MAP()
public:
afx_msg void OnBnClickedOk();
};
|
|
|
|
|
Check well the header(s), I suppose Visual Studio put in place the forward declaration for you (yes, VS does such things...).
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]
|
|
|
|
|
Thanks for the clue. The problem was with include order. Now I know that in i.e. "MyClass.cpp" the "MyClass.h" include should be the last include.
|
|
|
|
|
Hi all,
How can we write at a given sector in my hard disk?
I have tried it using this code but nothing happens
HANDLE hFile ;
DWORD dwResult;
hFile = CreateFile (L"\\\\.\\PhysicalDrive3",
GENERIC_WRITE,
0,
NULL,
CREATE_ALWAYS,
FILE_ATTRIBUTE_NORMAL,
NULL);
WriteFile (hFile, TEST_STR, strlen(TEST_STR), &dwResult, NULL);
Can anybody help me in this?
Thanks in advance
To accomplish great things, we must not only act, but also dream;
not only plan, but also believe.
|
|
|
|
|
I wrote some small tool to read and write HDD sectors 6 years ago under WinXP. If I recall correctly, the buffer has to fit the size of a sector (or n folds, aka: N * 512 bytes). Otherwise it rejects and nothing will happen.
Maxwell Chen
|
|
|
|
|
Well unfortunately Windows OS after 2000 or may be NT wouldn't allow you this, check out my post here
http://cyberlifeday.blogspot.com/2009/12/booting-windowslinux-os-any.html
in brief to do same, you'll need to change drive letter to A: or B:, read the post for reason and behind the scenes. 
|
|
|
|
|
Hi All,
Is there any way using which I can share my socket deccripter between multiple processes?
~ Vikram S
|
|
|
|
|
Apparently, yes [^](I never done it).
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]
|
|
|
|
|
Hi experts,
I have a dll that uses MFC as shared dll and it has many dialogs in it & was working fine till the time the project was in VS 2002 but recently I have converted the VS 2002 project to VS 2008 project and now none of the dialog is showing up. So, could anyone please suggest whats going wrong.
Regards,
Pankaj Sachdeva
There is no future lies in any job but future lies in the person who holds the job
|
|
|
|
|
Can you debug an see what is causing the issue?
|
|
|
|
|
DoModal is just returning -1 which means that DoModal is unable to create the dialog.
Regards,
Pankaj Sachdeva
There is no future lies in any job but future lies in the person who holds the job
|
|
|
|
|
Karismatic wrote: DoModal is just returning -1 which means that DoModal is unable to create the dialog.
Use GetLastError[^] to check the error code, it may give you some hints, hopefully.
|
|
|
|
|
Hi all,
I want to transfer a Wave File using UDP. how this is possible. Please give me steps what to follow exaclty. so that the wave file must be transfer to destination machine.
thanks in advance,
uday
|
|
|
|
|
|
first of all why you going for some file transfer using UDP, if you, then you need to implement something that counts on packets recieved, that would be something like tcp implementation, so why not just go for tcp as transport protocol moreover many ISP aren't good with UDP data transfer, I mean their bandwidth controller goes on dropping lot of UDP packets....
it'll be good if you elaborate your problem...tell you one interesting thing FTP is indeed based on UDP with same as I said above.
|
|
|
|
|
Its not my Intrest. Client want to Implement in UDP. So i have to go through that.
|
|
|
|
|
I am maintaining the source code which uses CButtonST buttons as icon controls to display transparent and overlay icons (for the small arrow at the corner of the main icon) on the GUI. User can change the icon.
When user is changing the icon, what I do in the code is to invoke CButtonST::SetIcon with another HICON handle. But there is the residue of the old icon which is unwanted. The new icon overlaps on top of the old one.
How to remove the old residue icon? Please advise. Thanks.
According to the comment by the author of CButtonST, calling SetIcon(0, 0) can remove any old icons from it.
[ quote ] // Pass NULL to remove any icon from the button. [ / quote ]
But in fact this call makes the application crash!
[Update]
I found someone had added two lines in CButtonST::FreeResources to do DeleteDC() and DeleteObject() . This issue was caused by these two calls. The problem is fixed after removing them.
Maxwell Chen
modified on Wednesday, December 30, 2009 3:36 AM
|
|
|
|
|
Can you debug and see why SetIcon(0, 0) fails?
|
|
|
|
|
Rejeesh.T.S wrote: Can you debug and see why SetIcon(0, 0) fails?
There are 3 versions of SetIcon , one is SetIcon(int, int) and the second is SetIcon(HICON, HICON) .
I think the compiler links it to SetIcon(int, int) when I wrote SetIcon(NULL, NULL) . So I casted it to force it invoke the correct version by SetIcon((HICON)NULL /* second arg has default val */) . And it does not crash now.
But there is still old residue icon. I just downloaded the demo source of CButtonST v3.9 from CodeProject, and modified the code to make it change icon dynamically. I do not see it have this problem. And I compared the source code of CButtonST between the demo source and my code. They look the same regarding the icon drawing portion. This is so weird ...
Maxwell Chen
|
|
|
|
|
Hi,
In my applcaiton i have lot of views.But mainframe should be hided.So i created as single document each view as follow
pGroupViewTemplate = new CSingleDocTemplate(
IDR_MAINFRAME,
RUNTIME_CLASS(CCentumVPDoc),
RUNTIME_CLASS(CFrameWnd),
RUNTIME_CLASS(CGroupView));
AddDocTemplate(pGroupViewTemplate);
pGraphViewTemplate = new CSingleDocTemplate(
IDR_MAINFRAME,
RUNTIME_CLASS(CCentumVPDoc),
RUNTIME_CLASS(CFrameWnd),
RUNTIME_CLASS(CGraphView));
AddDocTemplate(pGraphViewTemplate);
I wil hide the mainframe window by
pMainFrame->ShowWindow(SW_HIDE/*m_nCmdShow*/);
But now i want toolbars for every view.I dont know where i put the code for getting toolbar.If it is MDI wnidow,then i will put that code in chilframe class.
Mainly to hide mainframe window,i avoid MDI.
What cna i do?
Anu
|
|
|
|