|
I can only specificy (the way i know):
UTF7
UTF8
UTF32
Unicode
ASCII
and of course Default.
but my program requires:
windows-1250
How can i set other encoder like windows-1250 without using default?
|
|
|
|
|
Saksida Bojan wrote: but my program requires:
windows-1250
How can i set other encoder like windows-1250 without using default?
You can use Encoding::GetEncoding("windows-1250")
Regards,
Nish
|
|
|
|
|
Thanks for the help.
Do you know where can i get entire list for encoding?
|
|
|
|
|
hi guys;
the IMediaSeeking @ Duration didn't work, any thougth about that?
thanks
|
|
|
|
|
What library are you talking about there?
Regards,
Nish
|
|
|
|
|
#pragma once
using namespace System;
using namespace System::Runtime::InteropServices;
namespace QuartzTypeLib
{
[StructLayout(LayoutKind::Sequential), ComVisible(false)]
public ref class DsOptInt64
{
public:
DsOptInt64( long Value )
{
this->Value = Value;
}
long Value;
};
[Flags, ComVisible(false)]
public enum class SeekingCapabilities // AM_SEEKING_SeekingCapabilities AM_SEEKING_SEEKING_CAPABILITIES
{
CanSeekAbsolute = 0x001,
CanSeekForwards = 0x002,
CanSeekBackwards = 0x004,
CanGetCurrentPos = 0x008,
CanGetStopPos = 0x010,
CanGetDuration = 0x020,
CanPlayBackwards = 0x040,
CanDoSegments = 0x080,
Source = 0x100 // Doesn't pass thru used to count segment ends
};
[Flags, ComVisible(false)]
public enum class SeekingFlags // AM_SEEKING_SeekingFlags AM_SEEKING_SEEKING_FLAGS
{
NoPositioning = 0x00, // No change
AbsolutePositioning = 0x01, // Position is supplied and is absolute
RelativePositioning = 0x02, // Position is supplied and is relative
IncrementalPositioning = 0x03, // (Stop) position relative to current, useful for seeking when paused (use +1)
PositioningBitsMask = 0x03, // Useful mask
SeekToKeyFrame = 0x04, // Just seek to key frame (performance gain)
ReturnTime = 0x08, // Plug the media time equivalents back into the supplied LONGLONGs
Segment = 0x10, // At end just do EC_ENDOFSEGMENT, don't do EndOfStream
NoFlush = 0x20 // Don't flush
};
[ComVisible(true), ComImport,
Guid("36b73880-c2c8-11cf-8b46-00805f6cef60"),
InterfaceType( ComInterfaceType::InterfaceIsIUnknown )]
public interface class IMediaSeeking
{
[PreserveSig]
int GetCapabilities(SeekingCapabilities &pCapabilities );
[PreserveSig]
int CheckCapabilities( [In, Out] SeekingCapabilities &pCapabilities );
[PreserveSig]
int IsFormatSupported( [In] Guid& pFormat );
[PreserveSig]
int QueryPreferredFormat( [Out] Guid& pFormat );
[PreserveSig]
int GetTimeFormat( [Out] Guid& pFormat );
[PreserveSig]
int IsUsingTimeFormat( [In] Guid& pFormat );
[PreserveSig]
int SetTimeFormat( [In] Guid& pFormat );
[PreserveSig]
int GetDuration( long& pDuration );
[PreserveSig]
int GetStopPosition( long& pStop );
[PreserveSig]
int GetCurrentPosition( long &pCurrent );
[PreserveSig]
int ConvertTimeFormat( long& pTarget, [In] Guid& pTargetFormat,
long& Source, [In] Guid& pSourceFormat );
[PreserveSig]
int SetPositions(
[In, Out, MarshalAs(UnmanagedType::LPStruct)] DsOptInt64^ pCurrent,
SeekingFlags dwCurrentFlags,
[In, Out, MarshalAs(UnmanagedType::LPStruct)] DsOptInt64^ pStop,
SeekingFlags dwStopFlags );
[PreserveSig]
int GetPositions( long &pCurrent, long &pStop );
[PreserveSig]
int GetAvailable( long &pEarliest, long &pLatest );
[PreserveSig]
int SetRate( double dRate );
[PreserveSig]
int GetRate( double& pdRate );
[PreserveSig]
int GetPreroll( long &pllPreroll );
};
}
|
|
|
|
|
Are you trying to use CCW on the Quartz library (I assume it's a COM library). And if so, in what way is it not working? You said Duration failed - do you mean that a call to GetDuration failed?
If the error is more on the COM side, you might have to repost this question in the COM forum.
Regards,
Nish
|
|
|
|
|
After having such a piss-poor time with VS2005 destroying WinForms whenever I alter resX files, I gave up on it and put string literals directly in code. Now that I'm going back and doing cleanup, I want to remove those and put them into a resource file. Has anybody else had this same problem with C++/CLI projects? If so, how are you managing string resources?
|
|
|
|
|
If you can outline the minimal steps to reproduce the problem, I can check if I get it too.
Regards,
Nish
|
|
|
|
|
I asked the same question on the MSDN forums and received a good suggestion to create a second resX file and placed localizable strings in there. I think I'm going to do that.
|
|
|
|
|
espeir wrote: I asked the same question on the MSDN forums and received a good suggestion to create a second resX file and placed localizable strings in there. I think I'm going to do that.
Ok, good luck with that
Regards,
Nish
|
|
|
|
|
Hi,
i've made a managed wrapper(Managed Extensions) for a class, that was written in C++ with VS 6.0.
It works very fine but here's my problem:
I'd like to debug code of my C++-class. Any searches with google led to nothing.
Hope here in this discussion board there are some people who can help me ?
My environments:
VC++ 6.0 which i compiled the dll (source is available)
VS++ 7.0 2003 2 project: 1 project defines a managed wrapper which delegates all methode-calls to
the aggregated C++-class.
Thanx in advance
Eddy
|
|
|
|
|
VC 2003 does support mixed-mode debugging, but it's slow and doesn't work well all the time. You could force a debugger break by using an __asm int 3
Regards,
Nish
|
|
|
|
|
hello nish's,
this is right and i can set this debug-property, but
it wouldn't work practically ? If i debug, it will not jump into
source-code of the dll-VC6.0 project.
Have i set another switch or something else ?
thanx
|
|
|
|
|
It's been a while since I used VC 2003 to do a managed DLL, but if I remember right, it does break into the source code for the VC6 DLL, provided there's debug information in it.
Regards,
Nish
|
|
|
|
|
Hi,
I've just got Visual Studio 2005 Standard Edition and was writing a new CLR class
using this code
<br />
#using "System.dll"<br />
<br />
using namespace System;<br />
<br />
<br />
public ref class SimpleClass<br />
{<br />
public:<br />
SimpleClass();<br />
SimpleClass(System::String^ str,System::Int32 age);<br />
~SimpleClass();<br />
<br />
System::String^ GetName() {return _str;}<br />
void SetName(System::String^ str) {_str = str;}<br />
System::Int32 GetAge() {return _age;}<br />
<br />
private:<br />
System::Int32 _age;<br />
System::String^ _str;<br />
};<br />
<br />
SimpleClass::SimpleClass()<br />
{}<br />
<br />
SimpleClass::~SimpleClass()<br />
{}<br />
<br />
SimpleClass::SimpleClass(System::String^ str,System::Int32 age)<br />
{<br />
_str = str;<br />
_age = age;<br />
}<br />
then i wrote a cpp file
<br />
#include "simpleclass.h"<br />
<br />
int main()<br />
{<br />
SimpleClass SC = gcnew SimpleClass("Bob",13);<br />
<br />
Console::WriteLine(SC.GetAge());<br />
<br />
<br />
return 0;<br />
}<br />
I tried two modifactions both using the new '^' handle operator and normal class by saying
SimpleClass SC = gcnew SimpleClass().
However when i tried using "gcnew SimpleClass() it came up with error, no copy constructor.
So I wrote this :
<br />
SimpleClass(const SimpleClass& rhs);<br />
and it came up with several errors.
How do you write a copy constructor in C++ 2.0 please
Thanks
Tom
|
|
|
|
|
>>SimpleClass SC = gcnew SimpleClass();<<
SC is not a handle type. gcnew returns a handle.
You need to do one of these :-
SimpleClass^ SC = gcnew SimpleClass();
or
SimpleClass SC; //stack semantics
You don't need a copy constructor.
Regards,
Nish
-- modified at 9:20 Friday 13th January, 2006
|
|
|
|
|
Hi Nisht,
Thanks for the help!
I wanted to use like the class like this.
public ref class Class1 {
public:
void foo() {Console::Writeline("Hello World");
}
Class^ C1 = gcnew Class1();
C1->foo();
Class C2;
C2.foo()
Can that be done with managed classes.
Tom
|
|
|
|
|
|
I can make any of my MC++ classes have static properties (via the property keyword), but how can I create a property list dynamically at runtime?
Example?
Neil
|
|
|
|
|
Neil_Scales wrote: I can make any of my MC++ classes have static properties (via the property keyword), but how can I create a property list dynamically at runtime?
You cannot alter a class at runtime. You could attempt to dynamically create a new class derived from another class and then instantiate it dynamically at runtime.
Regards,
Nish
|
|
|
|
|
Does anyone have the source code for calulating the hyperbolic sine of an unknown angle, preferable in radian, ( sinh x )?
using the standard library of sine is not allowed.
therefore im stucked at quite beginning.
anyone can help me please?
im doing this for my project.
thank lots...
|
|
|
|
|
You could look at the Standard Library sources, couldn't you? BTW, please be aware that this is the C++/CLI forum.
Regards,
Nish
|
|
|
|
|
Hello,
Here is my environment:
Visual Studio .NET 2003 Fr
Framework: 1.1 SP1
OS: Win2000 pro SP4
I want to instanciate some class of an older none-MFC DLL which was compiled in C++ 6, from a new C++ .Net application. I have all .h, .lib and .dll files of this library.
My goal is to create a wrapper of this DLL in C++.NET in order to use it in a C# project.
Is it possible to make such wrapper ? and what is the right way to do it ?
Thanks for your answer.
PS : Sorry for my English, I'm french
|
|
|
|
|
Yes, what you intend to do is very much possible. I assume you have a DLL that exports some native C++ classes. You can write a C++/CLI mixed-mode DLL, that contains managed classes that wrap these native classes. Accessing the native DLL from the mixed-mode DLL is the same as how you would have done it in the pre-.NET days. Go ahead and try it out. You can post any issues you run into on this forum.
Regards,
Nish
|
|
|
|