|
Thanks for the link.
But i kind of dislikes the way how msdn arrange their articles.. Very confusing. I click the links here and there and until the end i learn nothing. Any better tutorials or URLs?
This topic is definitely hard to find in google.
Regards,
Chua Wen Ching :p
|
|
|
|
|
Hello.
How I can save a high color image (16 bit) as 256 color (with .BMP Format) or fewer color with Managed C++ .
Thank you.
|
|
|
|
|
Searching the .NET SDK documentation would quickly reveal the System.Drawing.Bitmap class. It contains everything you need, from reading in the existing image to saving it as a different format (the extension isn't the only thing that needs to change) and with a different palette.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Hey all (I know this is one of Nish's strong points, so I'm looking at him),
I've got this app I'm working on that uses a tlbimp-generated interop library to the Adobe Forms API. Works great, except I've got this unavoidable loop that looks something like this (C# code):
(the '...'s mean "not important or not the slow-down")
<br />
for( ... ) {<br />
AdobeInterop.Field theField = ...;<br />
theField.Value = "some rather long string value";<br />
Marshal.ReleaseCOMObject( theField );<br />
}<br />
The source of my problem is the line where I'm setting the "Value" property of that Field object (it is defined as a BSTR* in the original typelibs). The performance is absolutely horrible!
Are there any other methods I can use to inject the string values into this field? I know one option would be to custom craft a MC++ wrapper for the original COM interfaces, but this is really my last option. Are there any underground tips or tricks that we can use to help the Marshalling process along?
Ah well...thanks to all in advance,
Jeremy Kimball
[EDIT]Crud, I just realized I posted this in the MC++ board...where would be the best place for this?[/EDIT]
|
|
|
|
|
Jeremy Kimball wrote:
theField.Value = "some rather long string value";
Do you always assign a literal string value or do you assign the value of an existing System::String object?
If you are using literal strings would using the S prefix as in S"...." improve things (perhaps you could try this out).
Otherwise I dont see how you can directly do very much because the marshalling is doen by the RCW right?
BTW the fastest option would be IJW/MC++. But I guess you have your reasons for wanting to use RCW (possibly a preference for C#)
Jeremy Kimball wrote:
Crud, I just realized I posted this in the MC++ board...where would be the best place for this?
I think the forum you picked is fine
Regards
Nish
Extending MFC Applications with the .NET Framework [NW] (coming soon...)
Summer Love and Some more Cricket [NW] (My first novel)
Shog's review of SLASMC [NW]
Come with me if you want to live
|
|
|
|
|
|
Actually, I discovered a very sneaky workaround, so the point is moot now. Essentially I dump the form contents to a text file format, edit the values, then re-import it. I think the problem I was seeing is inherent to the Adobe automation objects themselves. There's no other reason I can imagine for such a marshalling delay in a simple string-BSTR transfer.
Neat article on IJW you posted here, though. I'll definitely have to remember that next time I run into something like this.
As for the "Why not MC++" question, the project consisted of about 50 or so C# classes, so I didn't want to break the brain of whoever had to maintain this thing once I did my thing. Although a quick-and-dirty MC++ COM wrapper might have been a useful thing...would IJW work in such a situation?
Thanks for the response Nish...
Jeremy Kimball
|
|
|
|
|
I have an MS access Database. and i have a table containing 6 columns in which one of them is of type OLE object . Please tell me how can i access that object throgh code. and i even nead for updation of that column.
|
|
|
|
|
In my latest book I illustrate somethign similar where I show how to read and wrote BLOB data to a SQL Server database using ADO.NET. If this is what you're looking for, let me know and I'll send you the code.
Cheers,
Tom Archer
Inside C#, Extending MFC Applications with the .NET Framework
It's better to listen to others than to speak, because I already know what I'm going to say anyway. - Jörgen Sigvardsson
|
|
|
|
|
Thanks for your Reply. Here I am accessing MS Access Database.
The problem is similar.So, If possible please send me the code so that i can use that.
Thanks in advance,
Regards,
Sivaram.
|
|
|
|
|
How do I get values from the <appSettings> section in the app.config file in managed C++?
|
|
|
|
|
See ConfigurationSettings.AppSettings property.
Mazy
No sig. available now.
|
|
|
|
|
I know how to use that in C# but I'm having trouble using it in C++. Do you have any sample syntax for this... I'm a little new to C++ syntax.
Thanks
|
|
|
|
|
Ok I got it. In C++ .Net you have to copy the file and rename it yourself. In C# and VB.Net It will do that for you.
Thanks
|
|
|
|
|
I have a main form class that I'm writing in MC++ and I have an options form that's written with C#. The problem: I have an Options class (written in MC++, not the form) that holds all the options. What I want to do is have a static Options class in the main form (MC++) and a static method to return that class. In the options form I want to be able to call this static method in order to retrieve the options. I'm coming across a similar problem I had earlier (http://www.codeproject.com/script/comments/forums.asp?msg=597331&forumid=3785#xx597331xx[^]). I can't reference the form in any way from the C# form. I don't want to have to compile the entire MC++ project as a dll and I don't want to move the main form out into a different project. I would like to know if there's some way I can simply export this one function so that I can use it in my C# form without having to change mountains of code. Thanks for reading my rambling post, and thank you to anyone who can help.
- monrobot13
|
|
|
|
|
I tried to run my code and somehow this error message display:
gecko10:> prof callproc1.pixie callproc1.Counts >profile.pixie
Assertion failed: LSYMHEADER(ldptr)->pcfd = (pCFDR)calloc(cbCFDR, LPHDR(ldptr)->ifdMax), file ../../libodebug/ldfcn.c, line 582
Where is ldfcn.h/ldfcn.c ? What caused this problem?
I read the man page for ldfcn but that does not tell me much.
thanks in advance.
db
|
|
|
|
|
Is there any tool that does Automatic doc generation like in C# but for MC++ ?
Jonathan de Halleux.
|
|
|
|
|
Throw exception when start:
TypeLoadExeption: Can't find type: _IMAGELIST from assembly.....
Why?
|
|
|
|
|
This actually doesn't have anything to do with WTL. It's an incomplete definition in the PSDK. Try adding the following definition:
struct _IMAGELIST{};
Cheers,
Tom Archer
Inside C#, Extending MFC Applications with the .NET Framework
It's better to listen to others than to speak, because I already know what I'm going to say anyway. - friend of Jörgen Sigvardsson
|
|
|
|
|
Hi guys,
I have been tasked with developing the new version of our web-based application, and my technology of choice for this is the .NET environment, primarily using managed C++.
The current application is ASP-based, althought his fact is not of particular interest to my request. In previous projects I have used ISAPI as a means of generating HTML content through Internet Information Server, and connecting on the server side to an ATL Service which is running independently of the web server. Essentially, the ATL service contains a single COM object that all other processes use by creating a proxy object which then interfaces with the singleton object. This service runs as an .exe.
I have written most of the objects as __gc classes that are exposed in a Managed .NET extension. I have hit the point now, where I want to have a singleton __gc class running in an .exe and for it to be accessible from an ISAPI extension.
I've trawled through many parts of MSDN, though not conclusively. I am trying to work out just how code in an ISAPI DLL, during a HTTP request, can pass on this call to the __gc ApplicationServer class residing in an EXE.
I'm not yet at the point of banging my head against the wall, but close, and any pointers on the way to do this would be appreciative. I haven't done so much as to prevent a slight redesign on the application front, so if that is what is required, so be it.
Many thanks in advance,
Ben Ashley
When it comes to maths and me, the wheel's going but the hamster's dead.
|
|
|
|
|
Sockets? I agree, that doesn't look like helpfull...
"...Ability to type is not enough to become a Programmer. Unless you type in VB. But then again you have to type really fast..."
Me
|
|
|
|
|
I'm a new-comer to mc++, so I thought I'd start with something simple but useful. I was going to create a mc++ dll that I could link to from a vc++ app to make use of the native image conversion functions in the .Net framework (without moving an existing project to mc++). This was progressing nicely until I tried exercise some control over the compression used when encoding the new file. This requires use of the ImageCodecInfo class, which unfortunately can't be used in c++ (due to a contained jagged array ). Okay, so now I'm trying move the offending functions to a c# class library, so they can be accessed by the mc++ dll, and in turn by the vc++ app. The result is an app the crashes before the first line of my own code is executed. At this point, I know that there are three CWinApps being instantiated. The first is a _afxOleWinApp (presumably related to the c# dll), the second is mc++ dll, and the third is the vc++ app that the crash occurs in. The CWinApp constructor apparently wants to confirm that there's not already a thread before it creates a new one, but the mc++ dll's CWinApp is now showing up as the afxGetThread(). The constructor ASSERTs and everything grinds to a halt before it even starts. (If I remove the calls to the c# dll the problem goes away.)
This can't be a fundamentally flawed idea, right? I'm using the System.Drawing.Dll without any problems. Can somebody at least confirm that this should work?
|
|
|
|
|
|
Thanks for the tip. I'm inclined to agree that this is the problem (or at least one of them). After applying their "solution", it just crashes someplace else (when creating an instance of the class in the C# class library). As experiments go, I think I've had just about enough negative reinforcement to convince me that this isn't a wise use of my time. Maybe my luck will change.
Thanks again.
|
|
|
|
|
Hi.
I have written a small program in c++, that is to be executed when the user logs off from the computer. The program is triggered by the User Logout event (this is set in the user policy in Novell ConsoleOne). The program is to write to a database, registring the users logout. The program works fine when I execute or debug it manually, but it's like it doesn't have time to finish or even start before it is preempted when the system shuts down. Since it is impossible to debug the program under logout it is hard to tell how far it gets before it is preempted. I have given the program top priority but that did not help.
Does anyone know what I can do so that the program is given time to finish at shut down?
Earlier we ran a similar program written in VB6 but for various reasons we wanted a new one and now the old one does not work since we moved up to Win-XP.
Thanks
/EnkelIk
|
|
|
|