|
The easist way is to start your application with an MDI or SDI. Since your code is dialog-based, you should not have many porting problem.
http://blog.joycode.com/jiangsheng
http://blog.csdn.net/jiangsheng
Command what is yours
Conquer what is not
---Kane
|
|
|
|
|
Hi,
I am able to wrapp all the class method in unmanaged c++ into managed c++ but i
could't able to wrapp Friend function. Please let me know if you have any idea.
Here is an example
Class UnManaged{
int i;
public:
UnManaged(int k){ i =k;}
friend int getInt(){return i};
friend bool operator < (Unmanaged *U1, Unmanaged *U2)
{return (U1->i <u2->i);}
}
How can wrapp These two function in my wrapper class called Mangaed.
public __gc class Managed {
Unmanaged __nogc *unmanagedObject
public:
Managed(){unManagedObject = new Unmanaged(10);
}
Thanks in Advance.
-Sudhakar
|
|
|
|
|
|
I have a database program. I am using accses databese with Microsoft.JET.4 Engine. Can i create a database with jet. If no, then i want to my own program create own database inplented in my project. How can i do this in "Less painful" way.
I hope you understand this, what i have to ask
|
|
|
|
|
hi Saksida Bojan!
The most unpainful way is to create XML files because .NET provides very comprehensive namespace for xml called System::Xml just use this and it will be even easier if you use serialization to deal with your XML files which can be found in System::Xml::Serialization. I have done it in VB and it worked fine for me, provided if you are not going to use very huge data processing.
Hope it helps.
osAma
|
|
|
|
|
I don't use xml file, but Access database throu Microsoft.Jet.4
|
|
|
|
|
You can easily create a Jet database using ADOX.
Here's an example in C#.
http://support.microsoft.com/kb/317881/EN-US/[^]
After you create the catalog you can add tables, then columns. I use this technique in one of my products.
Hope this helps.
-
Drew
|
|
|
|
|
Thanks. A lot. I'am changing entire core structer, so i don't have a time to test. When i finished then i will implent this structure.
|
|
|
|
|
Hi,
do any of you know how to open microsoft word in C++? i need to pass strings out to a template word document to fill in.
(john.parr@logicacmg.com)
I know the VB script method:
'Used to open word and populate CD label values in a word template'
Dim oWordApp
Dim oWordDoc
Set oWordApp = CreateObject("Word.Application")
If oWordApp Is Nothing Then
MsgBox "Couldn't start Word."
Else
oWordApp.visible =true
Set oDoc = oWordApp.Documents.Add("C:\cdtemplate.dot")
with oDoc
.bookmarks("mainTitle1").Range.text="HELLO"
.bookmarks("subTitle1").Range.text="TEST_DATA, PLAN_TEST - 393"
End If
|
|
|
|
|
This is the Visual C++ .NET forum.
The .NET way Interops the Word COM Dll, by converting it into a .NET assembly with TlbImp.exe and creating Runtime Callable Wrappers; (this makes it REALLY easy to manipulate the Word application object).
You probably want to ask this question at either the COM or Visual C++ forum.
|
|
|
|
|
Much thanks, I will ask in the said forum.
Thanks again
-John
|
|
|
|
|
I need to develop a system to monitor operations performed on files/folders.
Such as
1. open,
2. read,
3. write,
4. close,
5. copy,
6 rename,and
7. move
I have stumbled upon one solution.
Having a "File System Filter Driver" which monitors every atomic operation performed on the file system. But the information available out of the driver is too huge to classify into a single user operation.
For example
(*) IRP_MJ_WRITE is the Major function getting initiated when a user tries to write a file.
(*) However more than one IRP_MJ_WRITE happens for a single write.
(*) when user saves the document twice,it is difficult for me to group the IRP_MJ_WRITE's into TWO user writes.
Someone help me on how to proceed on this, or may be any other solution to this problem.
|
|
|
|
|
Google has plenty of hits, but it seems odd to me that you'd ask for something so complex, but want a complete source listing, rather than some references on how it works ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Hello Everyone:
This is my problem:
I have C# project compiled as a DLL. The C# class is defined as:
public Cs_Class
{
String name;
public Cs_Class(String n)
{ name = n; }
....
}
I have another MC++ project that uses the DLL. The MC++ class is defined as:
public Cpp_Class
{
....
void Test(String* testStr)
{
//Create the c# class
//
Cs_Class* c = new Cs_Class(testStr);
}
}
The compilation/linking was fine. I then encountered a run-time exception:
System.MissingMethodException: Method not found: Cs_Class..ctor(System.String)...
Strangly enough, if I took out the String parameter in Cs_Class constructor and not pass in String* in MC++ class when constructing the Cs_Class object, then everything was fine.
Why??
Thanks in advance.
David
David
|
|
|
|
|
Does anyone know where I can find pen-and-ink filter source code to transform images to pen-and-ink style?
Cheers
|
|
|
|
|
No, and I've looked around for sources on image filters a lot. However, I'd imagine that some sort of edge detection would be a good starting point.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Hi all,
I've got to add multi-language functionality to an application and don't really know where to start.
I need to be able to add new language files with the least amount of change. The language files are to be stored in a directory which the application will read. The language files are to be stored in DLLs. I'm wondering if anyone knows if it's possible to be able to add a file to the directory without having the project rebuilt. i.e. the app will pick up any new language files and add them/include them in the language options.
I was looking into using resource files and culture info for this project. Would this be a good way to go and could I get my required functionality by using this method?
All help gratefully recieved by a desperado.
|
|
|
|
|
Hi, I want to know if it's possible to use the standard J# library in a Managed C++ app and how to do it... Tnx.
|
|
|
|
|
Hi,
I'm trying to build a simple Preview graph application with a GUI made in C# accessing a Managed C++ DLL which contains classes that manage the DirectShow objects.
I can't see how the MC++ DLL itself could be causing isssues, but I could be wrong.
The problem I'm having is trying to connect the audio and video decoders into the "DirectSound Default Renderer" and "Video Renderer" respectively using the WinTV PVR 150.
When I try to connect the decoders to the renderers (audio or video) I get the HResult, 80040217. I can "manually" connect the filters in GraphEdit if I save the graph immediately before the failure in code. What does GraphEdit do differently when connecting to the renderers?
I could not get CaptureGraphBuilder to work with the PVR150 (as there is no preview pin on the PVR150s filter) so I have to programmatically connecting the renderers using GraphBuilder->Connect(). However, using CaptureGraphBuilder2 I was able to successfully build/run a preview graph using an Osprey 210 capture card using the same application.
How come I cannot programmatically connect the decoders to the renderers??
I've looked over many other renderer samples and they all use shortcuts like RenderFile and Render(), but no code I've seen connects it like I do.
My code is available at www.damiendonnelly.com/cv/rendererissues.zip.
-CVertex
|
|
|
|
|
I am currently working on a billing application and i need to be able to set a size limit on int's and fill the remaining slots with 0's ex. 0034567. I dont mind if it drops the 0's when i'm storing it but i need to know how to read it back with the 0's. I'm guessing that it might be possible when converting it to a string. Any ideas? Thanks
|
|
|
|
|
Expose the int through get and set methods. The set method strips extra numbers so you don't go past the maximum. The get method just returns it.
How you show the number is a rendering detail, your rendering layer should use an ostringstream, CString.Format or sprintf to format a string using the number to the format you're after.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Greetings,
I am new to the MC++ world, so I thought I would start with a simple unamanaged class, and wrap it in a managed class.
I was able to call and execute my managed .Net wrapper class from a C# form which appeared to work correctly. But I am not sure if my GetValue() function nees anything special such as a "__pin" call to make it safe for the managed code?
Here is my code:
// My unmanaged class.
// This implements a simple set and get method.
__nogc class CUnManaged
{
int nValue;
public:
CUnManaged()
{
nValue = 0;
}
void SetValue(int *val)
{
nValue = *val;
}
const int& Getvalue()
{
return nValue;
}
};
// My managed wrapper class
// Notice how "__pin" is used in the set.
public __gc class ManagedWrapper
{
CUnManaged2* pUnManaged;
public:
ManagedWrapper()
{
pUnManaged = new CUnManaged2();
}
~ManagedWrapper()
{
delete pUnManaged;
}
// The wrapper call to unmanaged set.
void SetValue(int val)
{
int someValue = val;
int __pin* pinnedInt = &someValue;
pUnManaged->SetValue(pinnedInt);
}
// Do I need to pin this value?
// Is this safe??????
int GetValue()
{
return pUnManaged->Getvalue();
}
};
|
|
|
|
|
Is it possible to create an array of an __gc class?
When I try, it says I cannot define a size of a __gc class or inside it.
Any answers to these newbie questions is highly appreichated.
|
|
|
|
|
There is:
public __gc class CTest<br />
{<br />
CTest(){}<br />
};<br />
<br />
CTest *test __gc[] = new CTest __gc *[4];
|
|
|
|
|
hi
Suppose I want an application which takes a source file and outputs its data members and functions.
Supposed to develop into a kind of class view explorer.
Regarding parsing the source file ....
should i go for using regular expressions rules for this parsing or
should i go for a language representation in context free grammer[CFG] and use the CFG rules for parsing
or is there any other possible ideas for source file parsing
awaiting advice
fordge
|
|
|
|