|
Hey,
Can any one help me, how I can get Single Doc/View based application without menu bar? I don't want to switch to Dialog based application ......
Thanks for your help!
Suresh
|
|
|
|
|
BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
{
if(cs.hMenu!=NULL)
{
::DestroyMenu(cs.hMenu);
cs.hMenu = NULL;
}
if( !CFrameWnd::PreCreateWindow(cs) )
return FALSE;
return TRUE;
}
Michael
CP Blog [^]
|
|
|
|
|
Got this! Thanks
|
|
|
|
|
I am using a standard algorithm coded from Visual C++.net
The heart of it is a formula I need to modifyfrom time to time.
As I need flexibility regarding this core formula, I would like to write it in an Excel cell, take the string via VBA and transfer it the heart of my C++ code in order modify calculation inside my algorithm.
It looks like an "uninteresting question" but solving that one could much simplify my daily life...
(How ) Is it possible to do that ?
Guillaume
|
|
|
|
|
Well you could expose a COM interface as part of your app that is consumable by VBA. That would probably be quite a load of work. Another approach would be to add interfacing with the Excel Object Model from within your app. While that would likely be much less work I cannot tell if it meets the needs of your use model.
Good luck
"No matter where you go, there your are." - Buckaroo Banzai
-pete
|
|
|
|
|
Yesterday (or the day before, I can't remember )
I asked how to print a CString (with RTF codes)
Here's the basic solution.
create a 'dummy' CRichEditCtrl.
create a 'dummy' Window to contain this control.
set the RTF text in the CRichEditCtrl.
Print from there.
That's it (hope it's helpful to anybody)!
(PS: not possible to give the code, because it's to hard to strip)
"If I don't see you in this world, I'll see you in the next one... and don't be late." ~ Jimi Hendrix
|
|
|
|
|
Hi,
I'm new in using windows sockets.
when I try to use windows sockets in my MFC application, I get the error "Could not start WinSock.DLL, error=0x276b".
in the InitInstance method, I have initialized winsock like this:
...
WSADATA ws;
if (!AfxSocketInit(&ws))
{
return FALSE;
}
...
event if I use the WSAStartup function, I get the messagebox error.
did I forgot to initialize something?
thanks for the help.
best regards.
There is no spoon.
|
|
|
|
|
I have not used AfxSocketInit but the the error it is reporting is
WSAStartup cannot function at this time because the underlying system it uses to provide network services is currently unavailable.
So WSAStartup is failing in both cases.
This is only speculation but you do have a network card in your machine don't you?
Ant.
I'm hard, yet soft. I'm coloured, yet clear. I'm fruity and sweet. I'm jelly, what am I? Muse on it further, I shall return! - David Williams (Little Britain)
|
|
|
|
|
Hi,
In fact, it's a problem of linking. when I link with ws2_32.lib and mswsock.lib instead of wsock32.lib , it works fine. so it seems that wsock32.lib does not work properly?
There is no spoon.
|
|
|
|
|
If you look at the documentation for WSAStartup it is defined in Winsock2.h and therefore you should link with Ws2_32.lib .
Ant.
I'm hard, yet soft. I'm coloured, yet clear. I'm fruity and sweet. I'm jelly, what am I? Muse on it further, I shall return! - David Williams (Little Britain)
|
|
|
|
|
Is it because you do not include link to
"Ws2_32.lib" ?
Sonork 100.41263:Anthony_Yio
|
|
|
|
|
Hi,
I have exclude wsock32.lib and included ws2_32.lib in the link properties of the project and I don't get the error message.
But when I create a project that uses Visual C+ 6 with Windows Socket support (this project doesn't have any ws2_32.lib defined, it compiles and runs correctly, and when I create the same project with VS .NET 2003, I have the error I mentionned above Also a project like shareaza have no exclude libraries (like I have done)... it's maybe a problem of linking configuration.
There is no spoon.
|
|
|
|
|
Try not to be dependent on the wizard but do it manually instead.
The basic winsock initialization.
//initialize winsock
WSADATA wsaData;
int iRet=WSAStartup(0x101,&wsaData);
if(iRet)
return false;
SOCKET con;
con=socket(AF_INET,SOCK_STREAM,IPPROTO_TCP);
if(con==INVALID_SOCKET)
return false;
//close connection
closesocket(con);
WSACleanup();
and include ws2_32.lib in the link.
Sonork 100.41263:Anthony_Yio
|
|
|
|
|
I have done manual links with ws2_32.lib and mswsock.lib instead of wsock32.lib and manual initialization and it works just fine thanks
There is no spoon.
|
|
|
|
|
Hi
In MDI application,to manage the documents,i want to add "list of documents opened as tree items" how can i do this ?Here tree is in instant bar.if i click the tree item corresponding document should be open.
adwance thanks to those who help me.
-Mahatma
|
|
|
|
|
I play video capture and files using windowless mode in Direct Show.I'd like to show just the video images in the native video sized application window. How can I do this ? Also there is a problem first displaying the file. The captured video or files can not be shown until the main application window is dragged by mouse. How can I update the view in a Doc/view architecture ?
Sincerely
Cem DEMiRKIR
|
|
|
|
|
I have a small project that generates XML formatted text on a file. Simple. In my class i create an ofstream that I just stream static text but also text generated from an operation. E.g. m_OFS << "\t\t<OBJECT Name=\"" << WritePart1() << "\">" << endl;
The problem here is that the operation call is evaluated first, then the rest of the statement resulting in an output looking like this:
MyA00000Var <OBJECT Name="0012FE80">
How do get it in the correct order? Of course i can break up the statement into three parts, like:
m_OFS << "\t\t<OBJECT Name=\""; WritePart1(); m_OFS << "\">" << endl;
But I would like to stream everything in a row.
(I hope the html output will look ok)
modified 26-Oct-22 21:01pm.
|
|
|
|
|
Why not do this
std::string strWritePart = WritePart1();
m_OFS << "\t\t<object Name=\"" << strWritePart << "\">" << endl;
Assuming WritePart1 returns a string
Ant.
I'm hard, yet soft. I'm coloured, yet clear. I'm fruity and sweet. I'm jelly, what am I? Muse on it further, I shall return! - David Williams (Little Britain)
|
|
|
|
|
I can't use unicode on controls of VC++7. But as i known, VC++ 7 supported unicode. Who can advise me?
|
|
|
|
|
Can you be more specific on the nature of your problem? What does can't use unicode mean? Doesn't the controls work? Or, as a pure guess, the character being shown does not come out correctly?
If it is the latter, you need to ensure that you are using a UNICODE compatible font for display in your control.
I Dream of Absolute Zero
|
|
|
|
|
HI .
A main Dialog Class CMainDlg
and child dialog CChildDlg ... and it memeber in mian diloag class m_childDlg
CMainDlg ::OnBtnPush()
{
SetTimer ( 22 , 1000 , NULL);
m_childDlg.DoModal();
}
IN On_Timer Event
{
if (nIDEvent == 22 )
{
KillTimer (22);
m_childDlg.CloseWnd();
}
}
in Child dialog Class
CChildDlg::CloseWnd()
{
AfxmessageBox(" helllooooo");
///message box is dispalyed afer timer elaps but
/// after that program crashes n not close the dialog
CDialog::OnOK();
}
Program Crashes on OnOK()
y plz tell me
thanx
Regards.
|
|
|
|
|
My guess would be that OnOK calls the closewindow function also...
"If I don't see you in this world, I'll see you in the next one... and don't be late." ~ Jimi Hendrix
|
|
|
|
|
What code do you have in OnOK() ?
Ant.
I'm hard, yet soft. I'm coloured, yet clear. I'm fruity and sweet. I'm jelly, what am I? Muse on it further, I shall return! - David Williams (Little Britain)
|
|
|
|
|
To Hello,
CDocument is used to manage data
CDialog is used as an interaction with the user to collect responses and data.
Somehow both class are not related, except deriving from CObject.
How can CDocument access CDialog data?
Since CView and CDialog is derived from CWnd, or how can CView pass the data from CDialog to CDocument.
Or has I miss some concept on the Doc/View architecture?
Thanks.
S1189216G
|
|
|
|
|
The easiest way is to pass a pointer to your CDocument class via the constructor of the CDialog derived class.
Michael
CP Blog [^]
|
|
|
|