|
I try, but compiler return erors:
too few arguments to function `float * biggest(float *, int)'
at this point in file
too few arguments to function `float * smallest(float *, int)'
at this point in file
|
|
|
|
|
I don't mean to sound mean but you should really be able to figure that one out.
-- Rocky Dean Pulley
|
|
|
|
|
O.K., Thank you anyway for yours great help and good understanding.
I'll try to do it well alone, but i'm not sure in access.
Thanks again and goodbay !
|
|
|
|
|
I want to switch dynamically from vertical to gorizontal split windows.
It's very easy (IMHO). But have little problem.
When my program started, I have two vertical split windows:
<br />
<br />
BOOL CMainFrame::OnCreateClient(LPCREATESTRUCT ,<br />
CCreateContext* pContext)<br />
{<br />
CreateSplitters(m_nRows, m_nCols, m_actRow, m_actCol, pContext);<br />
return TRUE;<br />
}<br />
<br />
BOOL CMainFrame::CreateSplitters(int nRows, int nCols, int m_actRow, int m_actCol, CCreateContext* pContext)<br />
{<br />
m_bInitSplitter = FALSE;<br />
my_RightView = RUNTIME_CLASS( CRightHTMLView );<br />
my_LeftView = RUNTIME_CLASS( CMyTree );<br />
<br />
<br />
<br />
CRect cr; <br />
GetClientRect( &cr);<br />
if ( !m_wndSplitter.CreateStatic( this, nRows, nCols ) ) <br />
{ <br />
MessageBox( "Error setting up splitter frames!", <br />
"Init Error!", MB_OK | MB_ICONERROR ); <br />
return FALSE; <br />
}<br />
int width = cr.Width();<br />
<br />
<br />
if ( !m_wndSplitter.CreateView( 0, 0, my_LeftView, <br />
CSize(width/5, cr.Height()), pContext ) || <br />
!m_wndSplitter.CreateView( m_actRow, m_actCol, my_RightView, <br />
CSize(4*width/5, cr.Height()), pContext )) <br />
{ <br />
MessageBox( "Error setting up splitter frames!", <br />
"Init Error!", MB_OK | MB_ICONERROR );<br />
return FALSE; <br />
}<br />
m_bInitSplitter = TRUE;<br />
<br />
return TRUE;<br />
<br />
}<br />
<br />
In in other functions I do not have pointer to CCreateContext structure, that is needed to create splitters.
Have can I retrive this pointer in any place of my object? This is very easy but I couldn't do it.
|
|
|
|
|
Hi all.
Has anyone any ideas on how to detect (programatically) the code page of a text file in Win32? At least in a way that makes the correct guess 90 % of the time?
For now, I'm testing different code pages with MultiByteToWideChar (CP_ANSI - CP_UTF8), counting the number of letters in the string (using iswalpha), and then the code page with the most letters wins. Feels shaky. This problem must have been around for ever, but I can't find any good ideas on how to deal with it.
Btw, there's a function called IsTextUnicode in the NLS API, does anyone know how to use it on reversed (MacOS) Unicode-files? I've tried the XXX_REVERSED flags, but the stupid function returns zero for every kind of input.
Any help or clues would be appreciated.
|
|
|
|
|
Recently I gone through a project in which I used a ".mdb" database.But whenever I took the application in different systems,I had to connect,once, the certain database manually by clicking "ODBC data sources Administrator" in control panel and choosing the right path.
I think it is not suitable for the users ,actually when the application is distributed,to do the right steps in connecting the database.
So,is it possible to code it within the project so that it automatically connects to its required database at the time of initialisation of the application for the first time?
|
|
|
|
|
joy007 wrote:
So,is it possible to code it within the project so that it automatically connects to its required database at the time of initialisation of the application for the first time?
Yes[^]
My programming blahblahblah blog. If you ever find anything useful here, please let me know to remove it.
|
|
|
|
|
I have a list control in Icon view. I add somes items with icon into my list, and my list open, I don't see all the text for each items. What I see is the icon, and under the icon, the begin of the text with "...". How can I see the full text without I need to click on the icon ?
|
|
|
|
|
Maybe this will help you:
LVS_EX_LABELTIP
Version 5.80. If a partially hidden label in any list-view mode lacks ToolTip text, the list-view control will unfold the label. If this style is not set, the list-view control will unfold partly hidden labels only for the large icon mode.
-- Rocky Dean Pulley
|
|
|
|
|
As far as i know, the list will never display more than two lines of text. However, you can increase the amount of text displayed by allowing more space between icons (this will let each row of text become longer). Use CListCtrl::SetIconSpacing() or LVM_SETICONSPACING to accomplish this.
BTW - rocky's suggestion is also good, as it lets you see the text while hovering the mouse over an icon, while keeping the spacing reasonable.
Shog9
I'm not the Jack of Diamonds... I'm not the six of spades.
I don't know what you thought; I'm not your astronaut...
|
|
|
|
|
Thank you, it's work fine
|
|
|
|
|
|
|
Hello i just want to create an xml using msxml3.0
but each and every time i am getting either a syntax error (in node creation) or a runtime error in (processing instruction).
the code is
IXMLDOMDocumentPtr document1=NULL;
IXMLDOMElementPtr elem1;
IXMLDOMNodePtr node;
IXMLDOMProcessingInstruction *IXMLDOMProcessingInstruction = NULL;
HRESULT hr;
BSTR bstrValue ;
node=document1->createNode(NODE_ELEMENT,"xml","version");
pIXMLDOMProcessingInstruction=document1->createProcessingInstruction ((BSTR)"xml",(BSTR)"version");
hr=document1->raw_createProcessingInstruction ((BSTR)"xml",(BSTR)"version",&pIXMLDOMProcessingInstruction);
the errors occured are:
in creating the node is :
error C2440: 'type cast' : enum MSXML::tagDOMNodeType' to 'const class _variant_t'
error in processing instruction are RUNTIME
the codes are correct, i don't wnat to use any wrapper class 4 the purpose.
msdn help is not very useful ,
ANy suggestion wld be helpful
Thx
Rahul Agarwal
|
|
|
|
|
Hello i just want to create an xml using msxml3.0
but each and every time i am getting either a syntax error (in node creation) or a runtime error in (processing instruction).
the code is
IXMLDOMDocumentPtr document1=NULL;
IXMLDOMElementPtr elem1;
IXMLDOMNodePtr node;
IXMLDOMProcessingInstruction *IXMLDOMProcessingInstruction = NULL;
HRESULT hr;
BSTR bstrValue ;
node=document1->createNode(NODE_ELEMENT,"xml","version");
pIXMLDOMProcessingInstruction=document1->createProcessingInstruction ((BSTR)"xml",(BSTR)"version");
hr=document1->raw_createProcessingInstruction ((BSTR)"xml",(BSTR)"version",&pIXMLDOMProcessingInstruction);
the errors occured are:
in creating the node is :
error C2440: 'type cast' : enum MSXML::tagDOMNodeType' to 'const class _variant_t'
error in processing instruction are RUNTIME
the codes are correct, i don't wnat to use any wrapper class 4 the purpose.
msdn help is not very useful ,
ANy suggestion wld be helpful
Thx
Rahul Agarwal
|
|
|
|
|
Hello Rahul!,
here is working code for IXMLDomDocument,i have taken this from MSDN but partly modified to run it on your compiler.Hope,it will work well for you
IXMLDOMDocument *pIXMLDOMDocument=NULL;
IXMLDOMElement *pIXMLDOMElement=NULL;
IXMLDOMProcessingInstruction *pIXMLDOMProcessingInstruction=NULL;
IXMLDOMNode *pIXMLDOMNode = NULL;
HRESULT hr ;
BSTR bstrValue ;
try
{
hr=CoCreateInstance(CLSID_DOMDocument,
NULL, CLSCTX_SERVER,
IID_IXMLDOMDocument,
(LPVOID*)(&pIXMLDOMDocument));
SUCCEEDED(hr) ? 0 : throw hr;
if(pIXMLDOMDocument)
{
hr=pIXMLDOMDocument->createElement(L"Node1", &pIXMLDOMElement);
if(SUCCEEDED(hr) && pIXMLDOMElement)
{
hr=pIXMLDOMElement->put_text(L"test");
if(SUCCEEDED(hr))
{
hr=pIXMLDOMDocument->createProcessingInstruction(L"xml",
L"version='1.0'", &pIXMLDOMProcessingInstruction);
if(SUCCEEDED(hr) && pIXMLDOMProcessingInstruction)
{
pIXMLDOMDocument->appendChild(pIXMLDOMProcessingInstruction,
&pIXMLDOMNode);
pIXMLDOMDocument->putref_documentElement(pIXMLDOMElement);
hr=pIXMLDOMDocument->get_xml(&bstrValue);
if(SUCCEEDED(hr))
{
::MessageBoxW(NULL, bstrValue, L"Loaded Doc", MB_OK);
bResult=TRUE;
}
if(pIXMLDOMNode)
pIXMLDOMNode->Release();
if(pIXMLDOMProcessingInstruction)
pIXMLDOMProcessingInstruction->Release();
}
}
if(pIXMLDOMElement)
pIXMLDOMElement->Release();
}
if(pIXMLDOMDocument)
pIXMLDOMDocument->Release() ;
}
}
catch(...)
{
if(pIXMLDOMElement)
pIXMLDOMElement->Release();
if(pIXMLDOMDocument)
pIXMLDOMDocument->Release();
if(pIXMLDOMNode)
pIXMLDOMNode->Release();
if(pIXMLDOMProcessingInstruction)
pIXMLDOMProcessingInstruction->Release();
}
Note: Please Post your COM related Query In it Specialized Forum.
"I Think this Will Help"
[Vote One Here,.....]
<h5
alok gupta="" <br=""> visit me at http://www.thisisalok.tk
|
|
|
|
|
I've to develop an simple SNTP server (no time performance are required).
Can someone give me some advices to develop it ?
I've created a RAW socket in order to receive any
message sent to my pc, to separate NTP messages
and to know the sender IP address and port. But it doesn't work !!
Is this the right way ?
Can someone help me ? Thanks a lot !!
|
|
|
|
|
I tried doing some stuff in windows with RAW sockets a while back and none of it would work (outside of simple PING stuff). I came to find out that windows didn't fully support RAW sockets. I don't know if this is still true with XP, but you may want to check into that.
-- Rocky Dean Pulley
|
|
|
|
|
Don't use RAW sockets, (S)NTP uses normal UDP. Create an UDP socket that listens on port 123.
|
|
|
|
|
Hi,
I have one application which will use CDialog::Create function to create one dialog at run time.
In normal cases it will be displayed correctly. But in some case (After abnormal crashing of application or Forcefull termination by killing the processs) it will displayed as full screen. But I am usng the same function both the cases.
Will anybody help me
|
|
|
|
|
|
I have a base class A. I have derived two classes B & C from A virtually. After that I have derived Class D from B and C. Class have a function fun().
I have created One object of D say obj and when I call obj.fun() it will call fun() of A.
Till now everything is fine.
But what is wondering me is how compiler knows weather fun() is coming to D through B or C as both have one copy of fun() and D also will have only one.
|
|
|
|
|
If I understand, your classes are like this?
class A { public: fun() { } };
class B : virtual public A { };
class C : virtual public A { };
class D : public B, public C { };
D obj;
obj.fun(); There is no ambiguity there because there is only one method called fun() . When you write obj.fun() , the compiler searches the inheritance tree for something called fun() and finds it in class A . Classes don't have "copies" of functions, the search for non-virtual methods is done at compile time.
--Mike--
LINKS~! Ericahist updated! | 1ClickPicGrabber | CP SearchBar v2.0.2 | C++ Forum FAQ
Strange things are afoot at the U+004B U+20DD
|
|
|
|
|
Is there any way to prevent MDI application from creating the initial child window?
|
|
|
|
|
Yes. See MSDN article Q141725.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|