|
kumarashoka wrote: a[2][2]={1,2,3,4,5}
{2,4,6,8,9}
To make this compilable, you'll need to make a larger and correct the syntax errors:
int a[2][5] =
{
{1,2,3,4,5},
{2,4,6,8,9}
};
"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 use a computer at work connecting to a group (local network). I wonder how can I disconnect it from the Internet by code?
Thank you masters!
|
|
|
|
|
Just search on google man
clue:- INetConnectionManager in vc++
More clue:-
u need three interface to do that
INetConnection* pConnect
INetConnectionManager* pMgr
IEnumNetConnection* pEnum
Using pMgr->EnumConnections( NCME_DEFAULT, &pEnum ) get all the connection
Loop it and check whether "Local Area Connection" or what ever connection you want to check
and call pConnect->Disconnect() to disconnect your NIC.
Величие не Бога может быть недооценена.
modified on Friday, August 7, 2009 12:20 AM
|
|
|
|
|
Hi All,
I am working on VC2008's MDI application with Ribbon bar and have to provide print preview.
Now, However VC2008 do have print preview, but the client requires it to look it like the VC6.0's Print preview capturing the entire main frame along with some certain buttons, all like VC6.0.
Can some body please help me on it
HARSH
Programmers are in a race with the Universe to create bigger and better idiot-proof programs, while the Universe is trying to create bigger and better idiots. So far the Universe is winning.
|
|
|
|
|
I'm not sure if it'll do what you want, but try this:
Find OnFilePrintPreview in your CView-derived class and replace its code with this:
void CYourViewDerivedClass::OnFilePrintPreview()
{
CPrintPreviewState *pState= new CPrintPreviewState;
if (!DoPrintPreview(IDD_AFXBAR_RES_PRINT_PREVIEW, this, RUNTIME_CLASS(CPreviewView), pState))
{
TRACE0("Error: OnFilePrintPreview failed.\n");
AfxMessageBox(AFX_IDP_COMMAND_FAILURE);
delete pState;
}
}
There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition.
Blaise Pascal
|
|
|
|
|
Hi sashoalm,
First thanks for replying...
I already know the way how to prepare print preview. But i guess i was not clear enough with my requirement.
My requirement is to show the preview capturing the entire main frame including all Menues, Panes, Views etc in VS 2008, how VS 6.0 does.
In VS2008, the preview comes like a view only and menues etc are remain enabled..
Please suggess something else may be that will help...
Thanks
HARSH
Programmers are in a race with the Universe to create bigger and better idiot-proof programs, while the Universe is trying to create bigger and better idiots. So far the Universe is winning.
|
|
|
|
|
OK, CMainFrame should have CMainFrame::OnFilePrintPreview method, try to place the code I posted in CMainFrame::OnFilePrintPreview instead and tell me what happened.
There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition.
Blaise Pascal
|
|
|
|
|
Hi,
Thanks for quick reply.
sashoalm wrote: try to place the code I posted in CMainFrame::OnFilePrintPreview
There is an issue in doing as you are saying but there is no such function "DoPrintPreview" in class CMDIFrameWndEx from which the CmainFrame Class is derived..
However, i already have tried:
CView *pView = GetActiveFrame()->GetActiveView();
if(pView == NULL)
{
return;
}
CPrintPreviewState* pState = new CPrintPreviewState;
if (!pView->DoPrintPreview(AFX_IDD_PREVIEW_TOOLBAR, pView,
RUNTIME_CLASS(CPreviewView), pState))
{
delete pState;
pState = NULL;
}
But it prepares the preview in the same document only and not capturing the frame.
And this not what i wanted
Please suggess something else.
HARSH
Programmers are in a race with the Universe to create bigger and better idiot-proof programs, while the Universe is trying to create bigger and better idiots. So far the Universe is winning.
|
|
|
|
|
What about minimizing the ribbon? Try minimizing the ribbon before print preview and see if you like it.
There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition.
Blaise Pascal
|
|
|
|
|
Hi Sashoalm,
sashoalm wrote: What about minimizing the ribbon? Try minimizing the ribbon before print preview and see if you like it.
It is not practically possible and good to hide all the ribbons, views and panes on Preview and restore them OnEndPreview since the are many in count..
Like in VC 6.0, i didn't needed to do any thing like that and the compiler was doing this for me, i want something like that.
Thanks
HARSH
Programmers are in a race with the Universe to create bigger and better idiot-proof programs, while the Universe is trying to create bigger and better idiots. So far the Universe is winning.
|
|
|
|
|
Harsh Shankar wrote: It is not practically possible and good to hide all the ribbons, views and panes on Preview and restore them OnEndPreview since the are many in count
What do you mean by that? You right-click on the ribbon bar and there's "Minimize the ribbon" *by default* in every MFC9 program. Why didn't you use that? Just do it and see how it looks. Not programatically - as a user - click on "Minimize the ribbon".
There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition.
Blaise Pascal
|
|
|
|
|
Hi sashoalam,
So do you think i should minimize all the Ribbons by some explicite call. But don't you think, making calls for hiding all the views, menues, tabs, Panes etc and maintaining its previous states is not really a good idea if you may have about 10 Ribbon-tabs, about 10-20 Panes and uncountable Views are possible.
Event on remembering the 6.0 days, you'll notice that we didn't have to do all those things by us and it was MFC's responsbility to do so.
i think must have understood my problem.
HARSH
Programmers are in a race with the Universe to create bigger and better idiot-proof programs, while the Universe is trying to create bigger and better idiots. So far the Universe is winning.
|
|
|
|
|
Harsh Shankar wrote: we didn't have to do all those things by us and it was MFC's responsbility to do so
Why are you telling this to me? I'm not the author of MFC. You should send this to the guys at Microsoft
There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition.
Blaise Pascal
|
|
|
|
|
I just want to clarify that I think the preview mode has just been changed in MFC 9.0 and probably there is no easy way to make it look the old way. If you don't like my suggestions then you're free not to follow them.
There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition.
Blaise Pascal
|
|
|
|
|
For many years we have a module that creates digital signatures. This module is based on the Microsoft Crypto API. We recently have a customer who requires all the certificates in the chain of trust (certificate->Issuer->Issuer->.....->Root) to be present in the signature blob. I have not yet figured-out how to do this. I could try to retrieve these certificates using "CertGetIssuerCertificateFromStore" and then adding them into the "rgpMsgCert" member of the "CRYPT_SIGN_MESSAGE_PARA" structure, but I do not know if this will actually do the trick....
Anybody have any more information about this issue?
Thanks a lot for your info.
William
|
|
|
|
|
Hi All
How can i read MySQL table in mfc like this.
Name Address
BAS UK
Bhy USA
Plz help me
|
|
|
|
|
You may use one of several technologies to connect with a MySQL database, see [^]. Once you've picked one of them it is just a matter of querying...
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 reply.
I know how to connect MySQL.I need help only get table values in MFC.
I know some command of MySQL(Select * From table) but i need to impliment in MFC.Plz help me
|
|
|
|
|
A quick search gave me the following results [^].
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,
I have an SDI based application. The view class has a base class CScrollView to accomodate large data. Horizontal and Verticals scrolls can be used for navigation.
Now I want to upload a bitmap having larger dimension but I am unable to do it. The client view accomodate only normal size of bitmap say (700*1100)... so what shold I do...
Also One have to write code in OnDraw() as when he navigates, so that bitmap upload again and the stuff is full of flickers. even then I could not view the EXTREME BOTTOM and EXTREME RIGHT of the image.
Please guide?
|
|
|
|
|
|
YES. I already set them to 1600.
void CTRYView::OnInitialUpdate()
{
CScrollView::OnInitialUpdate();
CSize sizeTotal;
// TODO: calculate the total size of this view
sizeTotal.cx = sizeTotal.cy = 1600;
SetScrollSizes(MM_TEXT, sizeTotal);
}
BUT no benefit?
|
|
|
|
|
use the setscrollsizes() function just before u try to load the image on the screen.
there is no need to handle drawing on scroll, onDraw automatically is called.
to avoid the flickering problem, u can try using memory DC by using the CreateCompatibleDC() and CreateCompatibleBitmap() functions. once the drawing is done, use the BitBlt() or stretchBlt to draw this to ur main Device context.
Pras
who else
|
|
|
|
|
use the setscrollsizes() function just before u try to load the image on the screen.
YES u are right . I called setscrollsizes() in OnInitialUpdate() whereas I load the bitmap against a menu click but still it is not working.
|
|
|
|
|
Hello,
I use this snippet to send message. m_pTextBlockFocused is a windowless RichEdit host class.
LRESULT lr;
m_pTextBlockFocused->GetTextServices())->TxSendMessage(EM_SETBKGNDCOLOR, 0, RGB(0,0,255), &lr);
The return value lr is 0. But in my opinion, that should be 0x00FFFFFF. By MSDN, this call should return the previous RGB value of background - white background.
Thanks,
Xiang
|
|
|
|