|
It seems, function GetXcaliburDataPath is declared to take CString& as parameter, where as you are sending address of string.
Modify it to,
GetXcaliburDataPath(strDataPath);
Prasad
MS MVP - VC++
|
|
|
|
|
In that case i am getting linker errors as unrecognzed token in the function GetXcaliburDataPath?
Thanks in advance.
Regards, Eswari
|
|
|
|
|
subramanyeswari wrote: CString strDataPath(strpath);
I'm curious what CString constructor takes a managed String pointer as an argument?
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
The VC7 CString class has a constructor that takes a managed String pointer and loads the CString with its contents:
//#include <atlstr.h>
System::String * str = S"Hello world\n";
CString str3(str);
printf(str3);
|
|
|
|
|
I figured that but I didn't see it in VS2003 so I thought maybe it was new to 2005...
I just looked again and there it is!
Thanks!
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
Hello,
I am trying to define an array , with the codes below , but it throws and exception can anyone tell me what i'm doing wrong?
array<__wchar_t> ^xArray = gcnew array<__wchar_t>(x->Length);
array<__wchar_t> ^yArray = gcnew array<__wchar_t>(y->Length);
dee
|
|
|
|
|
Obvious question, but you're using C++/CLI, right?
Are x and y both non-null ?
What exception are you getting?
David Anton
www.tangiblesoftwaresolutions.com
Instant C#: VB to C# converter
Instant VB: C# to VB converter
C++ to C# Converter: converts C++ to C#
Instant C++: converts C# to C++/CLI and VB to C++/CLI
Instant Python: converts C# to IronPython and VB to IronPython
|
|
|
|
|
Yes x and y are both non-null I get a null reference exception
dee
|
|
|
|
|
This is obviously C++/CLI - what is the exception ? What happens when you step through/check variables in the debugger ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Hi all,
I am transferring from .NET 2003 to .NET 2005 now. I have one application made in Visual C++.NET 2003. It is compiling fine in .NET 2005 but it gives one run time error at ShowDialog() function of OpenFileDialog Class object. Error is
"An unhandled exception of type 'System.Threading.ThreadStateException' occurred in System.Windows.Forms.dll
Additional information: Current thread must be set to single thread apartment (STA) mode before OLE calls can be made. Ensure that your Main function has STAThreadAttribute marked on it. This exception is only raised if a debugger is attached to the process."
Can I know what is wrong with this? And how can I solve this problem.
Thanks in advance,
Priyank
|
|
|
|
|
See here[^]
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
Is there any good samaritan there who could explain the difference between:
Visual C++ / MFC
(Managed) C++/CLI
Which forum should I address my questions if I am programming in C++ using the Win32 console application of VS2005?
Thanks
|
|
|
|
|
J_E_D_I wrote: Which forum should I address my questions if I am programming in C++ using the Win32 console application of VS2005
The Visual C++ / MFC one.
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.
|
|
|
|
|
My 2 cents...
Both are Visual C++.
If the C++ question relates to managed objects in C++, use the managed C++/CLI board.
For unmanaged related code in C++, or MFC framework questions, use the Visual C++/MFC board.
I have lots of modules that use both unmanaged MFC and managed C++. I just post those questions
on the VB board
I personally wouldn't mind the two boards combined. There's a separate .NET framework board for
.NET specific questions so C++ is C++. Actually a C++ board, an MFC board, and a .NET Framework
board makes the most sense to me.
Oh yeah, your question: Use the Visual C++ / MFC board.
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
From the sticky post at the top of the forum:
"Please post all standard C++ programming questions in the Visual C++ board."
|
|
|
|
|
Oh sure, bring RTFM technology into the discussion
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
Hello....I have this function(printinstance()) who generate me randomly boxes(whith another function) with width,height and depth, and I want to save the results in XML, but it only save me just the last box generated...can you figure out what it is the problem in my code please...I have to do this very quick and I am a beginer in XML.
where f-is the first box generated and l-is the last box generated
void printinstance(item *f, item *l, itype W, itype H, itype D)
{ int p,Wcont,Hcont,Dcont;
int const max=1000;
item *i,*j;
itype x1, y1, z1,x2, y2, z2;
stype vol, totvol;
int notip,po;
Wcont=(int)(W);
Hcont=(int)(H);
Dcont=(int)(D);
for (i=f;i<=l;i++)
{
notip=1;
x1 = i->dx; y1 = i->dy; z1 = i->dz;
for (j=i+1;j<=l;j++)
{
if ((i->dx==j->dx)&&(i->dy==j->dy)&&(i->dz==j->dz)) notip++;
}
p=1;
for (j=f;j if ((j->dx==i->dx)&&(j->dy==i->dy)&&(j->dz==i->dz))
{
p=0;
break;
}
if (p)
{
x1=i->dx;
y1=i->dy;
z1=i->dz;
XmlTextWriter^ writer = gcnew XmlTextWriter("d:\\contload.xml",Encoding::UTF8);
writer->Formatting = Formatting::Indented;
writer->Indentation=4;
writer->WriteStartDocument();
writer->WriteStartElement("ContainerSolution");
writer->WriteStartElement("ContainerDimensions");
writer->WriteAttributeString("ContainerWidth",W.ToString());
writer->WriteAttributeString("ContainerHeight",H.ToString());
writer->WriteAttributeString("ContainerDepth",D.ToString());
writer->WriteStartElement("Boxes");
writer->WriteAttributeString("BoxWidth",x1.ToString());
writer->WriteAttributeString("BoxHeight",y1.ToString());
writer->WriteAttributeString("BoxDepth",z1.ToString());
writer->WriteEndElement();
writer->WriteEndElement();
writer->WriteEndElement();
writer->WriteEndDocument();
writer->Close();}}}
and I call my function in the main program like this printinstance(f, l, W, H, D);
|
|
|
|
|
I tried to look through your code but because of HTML reformatting there's some stuff missing.
This is a short function - can't you step through with the debugger?
If it's only writing the last box then single stepping through one iteration should show you why
it's not writing any items except the last.
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
Hi all,
I've hunted around, but can't seem to find anything on this. I could be searching for the wrong keywords.
What I'd need to do, is monitor all the shares on the local pc, and take note of open files, and which user has the files open. So far I can use NetSession enum to get some info, but it gives me "[::1]" in the sesi2_cname field. It doesn't tell me what files are open though for the user it tells me about.
Does anyone have any recommendations?
Cheers
Jubjub
"If you're too careful, your whole life can become a f---in' grind." - Mike McD ( Rounders)
|
|
|
|
|
Finally found what I needed.
Use NetFileEnum.
"If you're too careful, your whole life can become a f---in' grind." - Mike McD ( Rounders)
|
|
|
|
|
I got this error from command prompt
DOS/16M: [2] not a DOS/16M executable 'C:\ASMM77\ASMM77.EXE'
How i can solve this error?
Thank You.
|
|
|
|
|
Wow - not only is this not a C++/CLI question, it doesn't look like a C++/programming question at all.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
hi friends
i have problem with my data structure in c++ and i need resource for data structure in c++ please introduce me new source and tell me how i can pass this course?
Thanks
|
|
|
|
|
|
Hi,
My class is defined as follows:
[DebuggerDisplay("Path: {m_hFilePath}")]
public ref class CVNAFile : Object
{
.
.
public:
String^ m_hFilePath;
.
.
};
It compiles without warnings but I see no change in debug from the way it worked without the attribute. Also I see no evidence of the attribute in ILDASM but I don't really know what to look for.
Thanks,
Bill Below
|
|
|
|