|
Just a stupid question, but have you installed that particular language on your machine? If not, please do it: Control panel -> Regional and language options -> ...
You may use the language bar to switch between languages and type it.
Shog on learning VB6: Ah, that would have been VB6. Kicked my ass anyway. So easy to learn, just like falling down a flight of stairs...
|
|
|
|
|
I guess I'll have to do that...
PS: Now I'll go to home and commit suicide by eating my computer keyboard...
Thank you for your help.
|
|
|
|
|
When we start something new, it would be the little things, that we would miss.
Anything I will say you will bring it down to whatever you want.
|
|
|
|
|
You hould hve tol m tht bfor... I'm finihing ith th lft prt of th kybord...
Thnk you for your fbck...
|
|
|
|
|
Didn't your mother teach you to not talk with your mouth full?
I can sympathize with learning about UNICODE. I went through this several years ago, when we first started worrying about Japanese versions of our products. Once you learn the 'best practices' for UNICODE, you'll never go back to writing MBCS-only applications. Well, maybe not .
Software Zen: delete this;
|
|
|
|
|
I have my algorithm in vc++2005 and I want to save my results in XML,I declared
#using <system.xml.dll>
using namespace System::Xml;
using namespace System::IO;
using System::Console;
using namespace System::Text;
using System::String;
and now I have some example made in c# for saving my data in XML, the two line from below are made in c++ :
String^ path = gcnew String("c:\\results.xml");
XmlTextWriter myXmlTextWriter = gcnew XmlTextWriter(path,0);
and it give me 2 errors like:
Error 1 error C2664: 'System::Xml::XmlTextWriter::XmlTextWriter(System::IO::Stream ^,System::Text::Encoding ^)' : cannot convert parameter 1 from 'System::String ^' to 'System::IO::Stream ^'
Error 2 error C3767: 'System::Xml::XmlTextWriter::XmlTextWriter': candidate function(s) not accessible
please help me ...I have to do this in 2 days..I am realy disperate
lavi
|
|
|
|
|
|
sorry I declare and : #using <system.xml.dll>
|
|
|
|
|
Maybe change
XmlTextWriter myXmlTextWriter = gcnew XmlTextWriter(path,0);
to
XmlTextWriter^ myXmlTextWriter = gcnew XmlTextWriter(path,0);
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
|
Hi, sorry for my bad english.
I have build a DLL with Visual C++ 2005 (C++/ATL) that use the Netica API for creating a bayesian net. With this API, I can only load a file from the disc and passing from a stream for reading the net. I would to embedd the net file (a simple txt) in the resource file (.rc), and passing to a stream.
The step that I using is :
stream = NewStreamFile_ns ("C:\PathToNetFile", ... );
net = ReadNet_bn ( stream, ... );
If I can redirect the file from the resource to the stream, I will be an happy man
I hope that someones help me.
Thanks in advance.
|
|
|
|
|
One way...
You can insert the text into the resource in Visual Studio by creating a custom resource.
Project Menu/Add Resource...
Click Custom... button
Name the resource type "TEXT" or whatever
paste the text into the binary editor.
To retrieve the resource you can use FindResource()/LoadResource()/LockResource()/etc.
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
Thank u, but I'm not an expert of this kind of programming, and I don't understand how I can do this.
The API is in C language.
the stream is defined as
typedef struct stream__ns stream_ns; //The structure is ignote (opaque pointer)
and I define the var as follow:
stream_ns * stream = NewStreamFile_ns ("C:\PathToNetFile", otherParams... );
net = ReadNet_bn ( stream, otherParams... );
Please help me
|
|
|
|
|
I was describing storing a text resource in an EXE/DLL and loading a text resource into memory
from an EXE/DLL.
Looking at the Netica C-API online, I don't see any way to use a memory stream - only file
streams.
Do they have support for the APIs?
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
I am using 'High-speed Charting Control' tutorial by Cedric Moonen to display 2D data. I have followed all the instructions mentioned on his tutorial but I am unable to get the graph of the 'ellipsoid curve' that he has mentioned. I have "Plot" Button on my GUI. On Click Event, I pasted the code that is given. The output that I get is that axis settings, background color gets changed, but it does not plot the data.
Thanks in advance.
Gaurav
|
|
|
|
|
Please, next time use the forum at the bottom at the article (scroll completely at the bottom of the page), that's the reason why they are there.
Did you post exactly the code that was in the example (I think there is even an error because the formating removed one space, but you can correct it easily) ?
If yes, did you follow all the other steps explained at the begining of the article ? I just tested here and it works fine.
So, what happens exactly ? When you start your application, how does the control looks like ? Like an empty chart control or like a blank rectangle ?
Did you check that the axis are correctly positioned ?
BTW, which IDE are you using ?
|
|
|
|
|
I am using Microsoft Visual c++ 6.0. I have a dialog based MFC application, here I have a button 'Plot'. On Click Plot, I have placed the code that is given in the tutorial.
The result that I see is - Title is addded, background color has been changed, but it does not plot the data.
void CCharttutorialDlg::OnPlot()
{
// TODO: Add your control notification handler code here
double X[361];
double Y[361];
CChartSerie *pLineSerie = m_ChartCtrl.AddSerie(CChartSerie::stLineSerie);
for (int i = 0; i < 361; i++)
{
X[i] = 10 * sin(i/360 * 2 * 3.141592);
Y[i] = 10 * cos( (i-60)/360 * 2 * 3.141592);
}
pLineSerie->SetPoints(X, Y, 361);
COLORREF TextColor = RGB(0,180,0);
COLORREF BackColor = RGB(0,50,0);
COLORREF GridColor = RGB(0,180,0);
COLORREF SerieColor = RGB(0,255,0);
m_ChartCtrl.SetEdgeType(EDGE_SUNKEN);
m_ChartCtrl.SetBorderColor(TextColor);
m_ChartCtrl.SetBackColor(BackColor);
m_ChartCtrl.GetBottomAxis()->SetMinMax(-15,15);
m_ChartCtrl.GetLeftAxis()->SetMinMax(-15,15);
m_ChartCtrl.GetBottomAxis()->SetColor(TextColor);
m_ChartCtrl.GetBottomAxis()->SetTextColor(TextColor);
m_ChartCtrl.GetBottomAxis()->GetGrid()->SetColor(GridColor);
m_ChartCtrl.GetLeftAxis()->SetColor(TextColor);
m_ChartCtrl.GetLeftAxis()->SetTextColor(TextColor);
m_ChartCtrl.GetLeftAxis()->GetGrid()->SetColor(GridColor);
m_ChartCtrl.GetTitle()->SetColor(TextColor);
m_ChartCtrl.GetTitle()->SetFont(140, "Times NewRoman");
m_ChartCtrl.GetTitle()->AddString("An example of Plot tutorial");
pLineSerie->SetColor(SerieColor);
m_ChartCtrl.RefreshCtrl();
}
Gaurav
|
|
|
|
|
The problem has nothing to do with the chart control but with how you use the sin and cos functions. If you use your debugger, you'll see that the values in each array are always the same. This is due to this:
X[i] = 10 * sin(i/360 * 2 * 3.141592);
If you look at my code, it is this:
X[i] = 10 * sin(i/360.0 * 2 * 3.141592);
Why does that make a difference ? Simply because when you divide two integers (i and 360), the result will always be an integer. In all cases, even if is something like 0.002 (it will be rounded to 0). If you do this: i/360.0, at least one of the operand (here the 360.0) is a float, thus the result will be a float, and you won't have an error of bounding.
(Of course, you need to do that for both the sin and the cos).
By the way, you should initialize the chart control (background, axis, title, ...) in your OnInitiDialog function, so that when you start your application, the control will look the same as when you click on the button.
|
|
|
|
|
|
how to change a button image when mouse is over and leave on button.
|
|
|
|
|
You could use TrackMouseEvent() using the button's HWND to request to receive WM_MOUSEHOVER and
WM_MOUSELEAVE messages. In response to those messages, change the button's bitmap appropriately.
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
Hi,
the previous answer is the best way, but if you are in VC++ and not so advanced in knowledge you can make something similar (but not optimal).
Check where the button is to know its coordinates in the actual map mode (if you don't know exactly where the button is at coding-time). Use the "void OnMouseMove(UINT nFlags, CPoint point)" and check if the cursor is On the button or Not.
I use it to change cursor when the user is on a moveable point in one graphical report.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
|
|
|
|
|
Hi,
I have serialized a tree control which container is a CView derived class. Everything works fine during serialization and unserialization.
Tree items display perfectly after Unserialization but a message box displays this text: "Unexpected file format."
this message is located in
Vc7\atlmfc\include\afxres.rc( line 74): AFX_IDP_FAILED_INVALID_FORMAT "Unexpected file format."
I’ve tried to find the reason of this message and also found a thread talking of the same problem @ : http://www.codeguru.com/forum/showt...ization+pointer
But no solution is provided. Could you please help me resolve this issue?
I use VS 2003 my application is based on an MDI document view and the message occurs in the debug and release version.
Many thanks for your help
|
|
|
|
|
Are you using CObject serialization?
Are you positive your serialize and unserialize code writes and reads the exact same number of
bytes to/from the file?
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
Yes I use CObject Serialization. About data storing and loading I indent the storing and I use "\r\n" to skip to the next line.
I have attached the code for your review.
void BnBSymbolTreeCtrl::Serialize(CArchive& ar)
{
BnBSymbolInfos* pInfo = NULL;
TVITEM tvi = {0};
UINT state = NULL; ;
LPARAM param = NULL ;
UINT mask = TVIF_HANDLE |TVIF_PARAM|TVIF_IMAGE|TVIF_SELECTEDIMAGE|TVIF_STATE|TVIF_TEXT;
int nImage = NULL;
int nSelectedImage = NULL;
if (ar.IsStoring())
{
HTREEITEM hti = GetRootItem();
while( hti )
{
tvi.mask = TVIF_HANDLE |TVIF_PARAM;
tvi.hItem =hti ;
GetItem(&tvi);
LPARAM param = tvi.lParam;
int nImage;
int nSelectedImage;
GetItemImage(hti, nImage, nSelectedImage);
UINT state = GetItemState(hti,TVIS_BOLD);
UINT ste = tvi.state;
CString str = GetItemText( hti );
int indent = GetIndentLevel( hti );
while( indent -- )
ar.WriteString( "\t" );
ar.WriteString( GetItemText( hti ) + "\r\n");
ar << state << param << nImage << nSelectedImage;
ar.WriteString("\r\n" );
pInfo = m_SymbolInfo.GetSymbolInfoObject(hti);
if(pInfo)
ar << pInfo->lparam;
ar.WriteString("\r\n" );
hti = GetNextNearItem( hti );
}
}
else
{
CString sLine;
if(!ar.ReadString( sLine ) )
return;
DeleteAllItems( );
HTREEITEM hti = NULL;
int indent, baseindent = 0;
CString strReturn = "\r\n";
while( sLine[baseindent] == '\t' )
baseindent++;
do
{
if( sLine.GetLength() == 0 )
continue;
for( indent = 0; sLine[indent] == '\t'; indent++ )
;
sLine = sLine.Right( sLine.GetLength() - indent );
indent -= baseindent;
HTREEITEM parent;
int previndent = GetIndentLevel( hti );
if( indent == previndent)
parent = GetParentItem( hti );
else if( indent > previndent )
parent = hti;
else
{
int nLevelsUp = previndent - indent;
parent = GetParentItem( hti );
while( nLevelsUp-- )
parent = GetParentItem( parent );
}
ar >> state >> param >> nImage >> nSelectedImage;
ar.ReadString(strReturn);
hti = InsertItem( mask, sLine,nImage, nSelectedImage,state,\
state ,param, parent ? parent : TVI_ROOT, TVI_LAST );
tvi.hItem = hti;
GetItem(&tvi);
pInfo = new BnBSymbolInfos();
ar >> pInfo->lparam;
if(pInfo)
{
if(pInfo->lparam == tvi.lParam)
{
tvi.lParam = reinterpret_cast<LPARAM> (pInfo);
SetItem(&tvi);
}
}
ar.ReadString(strReturn);
}while( ar.ReadString( sLine ));
}
}
|
|
|
|