473,439 Members | 1,731 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,439 software developers and data experts.

C call of a C# dll

Hi everybody,

Is it possible to
1. call a function from a dll made with .NET (C#)
2. from a program written in plain (as in: not .NET) C or C++?

To be more specific, this is what I have.

1.
C# file Class.cs:

using System; //and some other packages

namespace myns
{
public class Class
{
public Class()
{
}

public static byte[] getByteArray(
string name,
int index,
string format,
ref int n
) {
//Code returning some byte array.
}
}
}

Compiling it, I get myns.dll.

2.
C file mycaller.c:

#include <windows.h>
#include <stdio.h>
#include "mycaller.h"

typedef byte* (*FunctionPointer)(char*, int, char*, int*);

#ifdef __cplusplus
extern "C" {
#endif

byte* myfunc() {

//load the library
HINSTANCE m_libraryHandle = LoadLibrary("myns.dll");
if(m_libraryHandle != NULL) {
printf("Library loaded\n");
}
else {
printf("Library not loaded\n");
return NULL;
}

byte* result = NULL;

//get the function pointer
FunctionPointer functionptr =
(FunctionPointer)GetProcAddress(m_libraryHandle,
"getByteArray");

if(functionptr != NULL) {
printf("Function pointer is OK\n");

int n = -1;
//call the function from the loaded library
result = (*functionptr)("fubar1", 0, "fubar2", &n);

//some code modifying the result
}
else {
printf("Function pointer is NULL\n");
}

//free the library
FreeLibrary(m_libraryHandle);
printf("Library freed\n");

return result;
};

#ifdef __cplusplus
}
#endif

Now, the problem. Library gets loaded but the function pointer is
allways NULL.

1. Should the method call getByteArray() in Class.cs be "externalized"
somehow
in order for the call to be successful? If so, how do I "externalize" it?

2. Is the name of the function in GetProcAddress() wrong? Should I put the
namespace (myns) and class name (Class) in front of the method name? If
so, how
(I mean what delimiters do I use)?

3. Something else?

All help will be greatly appreciated. Thanks.
Nov 14 '05
77 3954
Mark McIntyre wrote:
I meant the dll in the C code.

But DLLs are a windows-specific construct, and nothing to do with C.


But if they're called shared objects (so's) then that's OK, right?
Nov 14 '05 #51
Mark McIntyre wrote:
On Tue, 21 Dec 2004 11:10:09 +0100, in comp.lang.c , Eltee
<el***@hotmail.com> wrote:

Then, to avoid confusion, you should rename your (sic!) NG
comp.lang.pure.c, comp.lang.1990iso.c, comp.lang.1999iso.c or
comp.lang.kr.c. ;-)

We were here first, by about 20 years.


20? Really? I thought the Great Renaming happened in 1987. Hm.
Otherwise guys like me will bother you with OT
questions all the time.

Only if you fail to follow nettiquette and don't lurk,


I can't afford to lurk. I need the info _now_. Yesterday, in fact.
Nov 14 '05 #52
On Thu, 23 Dec 2004 13:37:22 +0100, Eltee wrote:
Mark McIntyre wrote:
I meant the dll in the C code.

But DLLs are a windows-specific construct, and nothing to do with C.


But if they're called shared objects (so's) then that's OK, right?


Those have nothing to do with C either.

Lawrence

Nov 14 '05 #53
Mark McIntyre wrote:


But DLLs are a windows-specific construct,
Not so.
and nothing to do with C.


So. :-)

Nov 14 '05 #54
Eltee wrote:
Mark McIntyre wrote:
I meant the dll in the C code.


But DLLs are a windows-specific construct, and nothing to do with C.

But if they're called shared objects (so's) then that's OK, right?


No, C doesn't define shared objects either.
Nov 14 '05 #55
Lawrence Kirby wrote:
On Thu, 23 Dec 2004 13:37:22 +0100, Eltee wrote:

Mark McIntyre wrote:

I meant the dll in the C code.
But DLLs are a windows-specific construct, and nothing to do with C.


But if they're called shared objects (so's) then that's OK, right?

Those have nothing to do with C either.


Not in theory, no. But how can you live without them in the real world? I mean,
some orthodox biologist might say that pumping air into your lungs has nothing
to do with breathing, which, as we all know, happens at chemical level inside
your cells, but... BUT! ;-) If you're so strict in your understanding of the
"definition" of C then this whole c.l.c. business is just academic, right?
Nov 14 '05 #56
Eltee wrote:
Lawrence Kirby wrote:
On Thu, 23 Dec 2004 13:37:22 +0100, Eltee wrote:
But if they're called shared objects (so's) then that's OK, right?


Those have nothing to do with C either.

Not in theory, no. But how can you live without them in the real world?


Some people do in fact manage without them, but nobody would deny their
importance. Nevertheless, we don't discuss them here. That doesn't stop
us discussing them elsewhere, in newsgroups where such things are
topical.
Nov 14 '05 #57
On Thu, 23 Dec 2004 13:41:29 +0100, Eltee wrote:
Mark McIntyre wrote:
On Tue, 21 Dec 2004 11:10:09 +0100, in comp.lang.c , Eltee
<el***@hotmail.com> wrote:
....
Only if you fail to follow nettiquette and don't lurk,


I can't afford to lurk. I need the info _now_. Yesterday, in fact.


Then Usenet isn't the appropriate medium for your question.

Lawrence

Nov 14 '05 #58
On Thu, 23 Dec 2004 16:25:13 +0100, Eltee wrote:
Lawrence Kirby wrote:
On Thu, 23 Dec 2004 13:37:22 +0100, Eltee wrote:

Mark McIntyre wrote:
>I meant the dll in the C code.
But DLLs are a windows-specific construct, and nothing to do with C.

But if they're called shared objects (so's) then that's OK, right?

Those have nothing to do with C either.


Not in theory, no. But how can you live without them in the real world? I mean,
some orthodox biologist might say that pumping air into your lungs has nothing
to do with breathing, which, as we all know, happens at chemical level inside
your cells, but... BUT! ;-)


Do you mean breathing or respiration?
If you're so strict in your understanding of the
"definition" of C then this whole c.l.c. business is just academic, right?


The group is focussed, but that doesn't make it academic. A language like
C should allow me to write code that does something without
worrying about exactly what compiler I am using and other
implementation details. It can, and a great deal of useful code
can be written in that light. If you know what things you can rely on
irrespective of platform you are a long way to being able to program on
Windows, Unix, Macs, or a system you never heard of before but which has a
C compiler. You can argue that languages like Java take this further,
maybe C# could if it was implemented more widely. But C offers a lot in
that respect too.

Lawrence
Nov 14 '05 #59
Eltee wrote:
Mark McIntyre wrote:
I meant the dll in the C code.


But DLLs are a windows-specific construct, and nothing to do with C.

But if they're called shared objects (so's) then that's OK, right?


No, you silly twit. Where did you get such a stupid idea?
Nov 14 '05 #60
On Thu, 23 Dec 2004 13:37:22 +0100, in comp.lang.c , Eltee
<el***@hotmail.com> wrote:
Mark McIntyre wrote:
I meant the dll in the C code.

But DLLs are a windows-specific construct, and nothing to do with C.


But if they're called shared objects (so's) then that's OK, right?


What makes you think some unix-sounding thing is any more ontopic?
--
Mark McIntyre
CLC FAQ <http://www.eskimo.com/~scs/C-faq/top.html>
CLC readme: <http://www.ungerhu.com/jxh/clc.welcome.txt>

----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----
Nov 14 '05 #61
On Thu, 23 Dec 2004 16:25:13 +0100, in comp.lang.c , Eltee
<el***@hotmail.com> wrote:
Lawrence Kirby wrote:
On Thu, 23 Dec 2004 13:37:22 +0100, Eltee wrote:

Mark McIntyre wrote:
>I meant the dll in the C code.
But DLLs are a windows-specific construct, and nothing to do with C.

But if they're called shared objects (so's) then that's OK, right?

Those have nothing to do with C either.


Not in theory, no. But how can you live without them in the real world?


How the implementation provides services is immaterial to any decent C
programme. It can use shared objects, dynamic linking or carrier pigeon.

And if you're talking about writing your own shared code, C again doesn't
care - as long as you can link with the function somehow.
your cells, but... BUT! ;-) If you're so strict in your understanding of the
"definition" of C then this whole c.l.c. business is just academic, right?


Only if you're the sort of person who thinks its ok to intermingle
database, UI and programme code in one function.
--
Mark McIntyre
CLC FAQ <http://www.eskimo.com/~scs/C-faq/top.html>
CLC readme: <http://www.ungerhu.com/jxh/clc.welcome.txt>

----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----
Nov 14 '05 #62
On Thu, 23 Dec 2004 13:48:10 +0000 (UTC), in comp.lang.c , infobahn
<in******@btinternet.com> wrote:
Mark McIntyre wrote:


But DLLs are a windows-specific construct,


Not so.


Maybe, maybe not. Its offtopic here tho.

--
Mark McIntyre
CLC FAQ <http://www.eskimo.com/~scs/C-faq/top.html>
CLC readme: <http://www.ungerhu.com/jxh/clc.welcome.txt>

----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----
Nov 14 '05 #63
On Thu, 23 Dec 2004 13:41:29 +0100, in comp.lang.c , Eltee
<el***@hotmail.com> wrote:
Mark McIntyre wrote:
We were here first, by about 20 years.


20? Really? I thought the Great Renaming happened in 1987. Hm.


comp.lang.c was in existence before the Great Renaming. Its name changed,
but thats all.
Only if you fail to follow nettiquette and don't lurk,


I can't afford to lurk. I need the info _now_. Yesterday, in fact.


Then you're a complete idiot asking in usenet. This isn't instant
messaging, and if you want quick answers, you're barking up the wrong tree.
Go hire some consultants. :-)
--
Mark McIntyre
CLC FAQ <http://www.eskimo.com/~scs/C-faq/top.html>
CLC readme: <http://www.ungerhu.com/jxh/clc.welcome.txt>

----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----
Nov 14 '05 #64
Eltee <el***@hotmail.com> writes:
Mark McIntyre wrote:
On Tue, 21 Dec 2004 11:10:09 +0100, in comp.lang.c , Eltee
<el***@hotmail.com> wrote:
Then, to avoid confusion, you should rename your (sic!) NG
comp.lang.pure.c, comp.lang.1990iso.c, comp.lang.1999iso.c or
comp.lang.kr.c. ;-)

We were here first, by about 20 years.


20? Really? I thought the Great Renaming happened in 1987. Hm.


Yes, really.

1987 was 17 years ago, coming up on 18; that's close enough to be
called "about 20 years". Aside from that, comp.lang.c is the renamed
version of the old net.lang.c. I think net.lang.c was one of the
earliest newsgroups.
Otherwise guys like me will bother you with OT questions all the
time.

Only if you fail to follow nettiquette and don't lurk,


I can't afford to lurk. I need the info _now_. Yesterday, in fact.


I'm terribly sorry to hear that. If you need it yesterday, I'm afraid
you're too late. But you should seriously consider a different source
of information (possibly one costing money), since Usenet is not
designed to guarantee quick responses, and being upset with us for not
jumping to serve you is going to be counterproductive.

The urgency of your need for information does not imply an urgency on
our part to give it to you. We do this for fun; we're not customer
service.

But perhaps your need isn't quite as urgent as you seem to think it
is. If it were, you probably wouldn't have enough spare time on your
hands to come here and offer advice on how we should run our
newsgroup. (I use the term "our" loosely; comp.lang.c isn't anyone's
property, but those of us who have been regulars here for a long time
tend to feel some sense of responsibility for it.)

As for lurking, if your news server keeps articles for a long time you
can effectively lurk fairly quickly by skimming the saved articles.
Failing that, groups.google.com is a good substitute.

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
Nov 14 '05 #65
Lawrence Kirby wrote:
Then Usenet isn't the appropriate medium for your question.


Yes, so I gather.
Nov 14 '05 #66
Mark McIntyre wrote:
I can't afford to lurk. I need the info _now_. Yesterday, in fact.


Then you're a complete idiot asking in usenet. This isn't instant
messaging, and if you want quick answers, you're barking up the wrong tree.
Go hire some consultants. :-)


No, no, don't misunderstand me. The answers came quickly enough. They just
weren't what I expected. Lurking, on the other hand, means what? A fortnight,
maybe a month of being passive? That's not what I'm prepared to invest in this
one lousy thing. Moreover, thanks to infobahn who kindly directed me to other
more appropriate places, I got that info very quickly.
Nov 14 '05 #67
Keith Thompson wrote:
Eltee <el***@hotmail.com> writes:
Mark McIntyre wrote:
On Tue, 21 Dec 2004 11:10:09 +0100, in comp.lang.c , Eltee
<el***@hotmail.com> wrote:
Then, to avoid confusion, you should rename your (sic!) NG
comp.lang.pure.c, comp.lang.1990iso.c, comp.lang.1999iso.c or
comp.lang.kr.c. ;-)

We were here first, by about 20 years.
20? Really? I thought the Great Renaming happened in 1987. Hm.

Yes, really.

1987 was 17 years ago, coming up on 18; that's close enough to be
called "about 20 years".


:-))) That's a textbook example of something called rounding. And if it isn't,
it should be. I'm sure if you presented this to some banker, you'd get a job on
the spot.

Aside from that, comp.lang.c is the renamed
version of the old net.lang.c.
Yeah, sure. Just like C++ is the renamed version of C.
I think net.lang.c was one of the
earliest newsgroups.

Otherwise guys like me will bother you with OT questions all the
time.

Only if you fail to follow nettiquette and don't lurk,
I can't afford to lurk. I need the info _now_. Yesterday, in fact.

I'm terribly sorry to hear that. If you need it yesterday, I'm afraid
you're too late. But you should seriously consider a different source
of information (possibly one costing money), since Usenet is not
designed to guarantee quick responses, and being upset with us for not
jumping to serve you is going to be counterproductive.

The urgency of your need for information does not imply an urgency on
our part to give it to you. We do this for fun; we're not customer
service.

But perhaps your need isn't quite as urgent as you seem to think it
is. If it were, you probably wouldn't have enough spare time on your
hands to come here and offer advice on how we should run our
newsgroup. (I use the term "our" loosely;


No kidding?!? ;-)
comp.lang.c isn't anyone's
property, but those of us who have been regulars here for a long time
tend to feel some sense of responsibility for it.)

As for lurking, if your news server keeps articles for a long time you
can effectively lurk fairly quickly by skimming the saved articles.
Failing that, groups.google.com is a good substitute.


Not only the groups, the whole google. Don't think I haven't tried there first.
Nov 14 '05 #68
On Sun, 26 Dec 2004 18:29:08 +0100, in comp.lang.c , Eltee
<el***@hotmail.com> wrote:
The answers came quickly enough. They just weren't what I expected.
Thats unfortunate, but not exactly anyone here's fault.
Lurking, on the other hand, means what? A fortnight,
maybe a month of being passive? That's not what I'm prepared to invest in this
one lousy thing.
The thing is, when that attitude becomes apparent to others, they are
highly likely to take the same view - why should they bother to help you
when you can't be bothered to investigate for yourself?
Moreover, thanks to infobahn who kindly directed me to other
more appropriate places, I got that info very quickly.


Good.

--
Mark McIntyre
CLC FAQ <http://www.eskimo.com/~scs/C-faq/top.html>
CLC readme: <http://www.ungerhu.com/jxh/clc.welcome.txt>

----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----
Nov 14 '05 #69
On Sun, 26 Dec 2004 18:34:39 +0100, in comp.lang.c , Eltee
<el***@hotmail.com> wrote:
Keith Thompson wrote:
Aside from that, comp.lang.c is the renamed
version of the old net.lang.c.


Yeah, sure. Just like C++ is the renamed version of C.


No, just like net.lang.c was renamed comp.lang.c during the great renaming.
As for lurking, if your news server keeps articles for a long time you
can effectively lurk fairly quickly by skimming the saved articles.
Failing that, groups.google.com is a good substitute.


Not only the groups, the whole google. Don't think I haven't tried there first.


Then you need to brush up your google skills - I got about 100 useful hits
in 0.24 seconds.

--
Mark McIntyre
CLC FAQ <http://www.eskimo.com/~scs/C-faq/top.html>
CLC readme: <http://www.ungerhu.com/jxh/clc.welcome.txt>

----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----
Nov 14 '05 #70
Eltee <el***@hotmail.com> writes:
Keith Thompson wrote:
Eltee <el***@hotmail.com> writes:
Mark McIntyre wrote: [...]We were here first, by about 20 years.

20? Really? I thought the Great Renaming happened in 1987. Hm.

Yes, really.
1987 was 17 years ago, coming up on 18; that's close enough to be
called "about 20 years".


:-))) That's a textbook example of something called rounding. And if
it isn't, it should be. I'm sure if you presented this to some banker,
you'd get a job on the spot.


What's your point? In banking, rounding $17 to $20 can get you fired
or arrested. In a casual conversation like this one, referring to a
17-year period as "about 20 years" (note that this is *explicitly* an
approximation) is perfectly appropriate, and whining about it makes
you look like a fool.
> Aside from that, comp.lang.c is the renamed
version of the old net.lang.c.


Yeah, sure. Just like C++ is the renamed version of C.


Not at all. comp.lang.c is, for all practical purposes, the same
newsgroup as the old net.lang.c; only the name changed. C++ is a new
and distinct language based on C. Again, what's your point? I'm
beginning to doubt that you have one.

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
Nov 14 '05 #71
Mark McIntyre wrote:
On Sun, 26 Dec 2004 18:29:08 +0100, in comp.lang.c , Eltee
<el***@hotmail.com> wrote:

The answers came quickly enough. They just weren't what I expected.

Thats unfortunate, but not exactly anyone here's fault.


Of course not. I never said anything like that.
Lurking, on the other hand, means what? A fortnight,
maybe a month of being passive? That's not what I'm prepared to invest in this
one lousy thing.

The thing is, when that attitude becomes apparent to others, they are
highly likely to take the same view - why should they bother to help you
when you can't be bothered to investigate for yourself?


But I _am_ investigating. I'm not relying (only) on Usenet. It's just that I had
good experience with Usenet so far. Especially with "little" things,
directions mostly, the things that don't require knowing all the gory details of
a particular "technology".
Moreover, thanks to infobahn who kindly directed me to other
more appropriate places, I got that info very quickly.

Good.

Nov 14 '05 #72
Mark McIntyre wrote:
As for lurking, if your news server keeps articles for a long time you
can effectively lurk fairly quickly by skimming the saved articles.
Failing that, groups.google.com is a good substitute.
Not only the groups, the whole google. Don't think I haven't tried there first.

Then you need to brush up your google skills


Perhaps.
- I got about 100 useful hits
in 0.24 seconds.


That's what I'm talking about. What would it take for you to just post that info
here? Do you want me to beg for it?
Nov 14 '05 #73
Keith Thompson wrote:
Eltee <el***@hotmail.com> writes:
Keith Thompson wrote:
Eltee <el***@hotmail.com> writes:

Mark McIntyre wrote:
[...]
We were here first, by about 20 years.

20? Really? I thought the Great Renaming happened in 1987. Hm.

Yes, really.
1987 was 17 years ago, coming up on 18; that's close enough to be
called "about 20 years".


:-))) That's a textbook example of something called rounding. And if
it isn't, it should be. I'm sure if you presented this to some banker,
you'd get a job on the spot.

What's your point? In banking, rounding $17 to $20 can get you fired
or arrested. In a casual conversation like this one, referring to a
17-year period as "about 20 years" (note that this is *explicitly* an
approximation) is perfectly appropriate, and whining about it makes
you look like a fool.


A quote from the clc welcome message:

Accuracy is valued very highly in this
newsgroup; therefore posts are frequently corrected, sometimes perhaps
too harshly, and often to the annoyance of new posters who consider the
correction trivial. Do not take it personally;

So, now, which is it? Accurate or casual? Looks like it's both: accurate when
you have to bash somebody else for their casualness and casual when you want to
bash them for their accuracy.
> Aside from that, comp.lang.c is the renamed

version of the old net.lang.c.


Yeah, sure. Just like C++ is the renamed version of C.

Not at all. comp.lang.c is, for all practical purposes, the same
newsgroup as the old net.lang.c; only the name changed. C++ is a new
and distinct language based on C. Again, what's your point? I'm
beginning to doubt that you have one.


My point is that for all practical purposes, C and C++ are strongly related (to
put it mildly). And for all practical purposes, loading a shared library is on
the menu of every decent programmer. So, for all practical purposes, that makes
it, de facto, a part of the language. I'm using "a part of" _casualy_, of course.
Nov 14 '05 #74
Eltee <el***@hotmail.com> writes:
Keith Thompson wrote:
Eltee <el***@hotmail.com> writes: [Silly argument regarding "about 20 years" vs. "17 years" snipped]
A quote from the clc welcome message:

Accuracy is valued very highly in this
newsgroup; therefore posts are frequently corrected, sometimes perhaps
too harshly, and often to the annoyance of new posters who consider the
correction trivial. Do not take it personally;

So, now, which is it? Accurate or casual? Looks like it's both:
accurate when you have to bash somebody else for their casualness and
casual when you want to bash them for their accuracy.
There is nothing incorrect about referring to a period of 17 years as
"about 20 years". It was less precise than the kind of wording you
might expect in, say, a language standard, but it was as precise as it
needed to be in context. The point would have been equally valid if
the time period in question were 10 years or 30 years.

This is the last thing I'm going to say about it.
> Aside from that, comp.lang.c is the renamed

version of the old net.lang.c.

Yeah, sure. Just like C++ is the renamed version of C.

Not at all. comp.lang.c is, for all practical purposes, the same
newsgroup as the old net.lang.c; only the name changed. C++ is a new
and distinct language based on C. Again, what's your point? I'm
beginning to doubt that you have one.


My point is that for all practical purposes, C and C++ are strongly
related (to put it mildly).


Yes, C and C++ are strongly related. but they are two distinct
languages. Questions about C++ are unquestionably off-topic here in
comp.lang.c; that's why comp.lang.c++ exists.
And for all practical purposes, loading a
shared library is on the menu of every decent programmer.
Perhaps. Personally, I rarely deal explicitly with shared libraries;
I leave that to the operating system.
So, for all
practical purposes, that makes it, de facto, a part of the
language. I'm using "a part of" _casualy_, of course.


No, it's not part of the language, it's a feature of the
implementation. We've been telling you for days that your question is
off-topic. Personally, I have no idea what the answer is. It's
likely you could get the information you're looking for in a
Windows-specific newsgroup, either one of the comp.os.ms-windows.*
groups or one of Microsoft's own microsoft.* groups. Have you tried?

Note that I'm not complaining about your original post. It's not
immediately obvious that a question about calling C# from C is
off-topic in comp.lang.c. But now you know that it is.

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
Nov 14 '05 #75
On Mon, 27 Dec 2004 09:38:56 +0100, in comp.lang.c , Eltee
<el***@hotmail.com> wrote:
And for all practical purposes, loading a shared library is on
the menu of every decent programmer.
No its not. I can't remember the last time I had to care about loading
shared libraries. Your OS should take care of that sort of nonsense for
you.
So, for all practical purposes, that makes
it, de facto, a part of the language.
No, because the langauage is defined by an international standard,.
I'm using "a part of" _casualy_, of course.


Be as casual as you like but don't expect anyone to help you much.
--
Mark McIntyre
CLC FAQ <http://www.eskimo.com/~scs/C-faq/top.html>
CLC readme: <http://www.ungerhu.com/jxh/clc.welcome.txt>
Nov 14 '05 #76
On Mon, 27 Dec 2004, Eltee wrote:
Keith Thompson wrote:

What's your point? In banking, rounding $17 to $20 can get you fired
or arrested. In a casual conversation like this one, referring to a
17-year period as "about 20 years" (note that this is *explicitly* an
approximation) is perfectly appropriate, and whining about it makes
you look like a fool.


A quote from the clc welcome message:

Accuracy is valued very highly in this
newsgroup; therefore posts are frequently corrected, sometimes perhaps
too harshly, and often to the annoyance of new posters who consider the
correction trivial. Do not take it personally;

So, now, which is it? Accurate or casual? Looks like it's both: accurate when
you have to bash somebody else for their casualness and casual when you want
to bash them for their accuracy.


Let me guess, you don't work much with floating point? ;)
Nov 14 '05 #77
"Richard Blewett [DevelopMentor]" wrote:

You can register the .NET class as a COM class (see regasm.exe)
and use CoCreateInstance and friends to call it - you can create
a typelib for your assembly using tlbexp.exe .... snip ...
Is it possible to
1. call a function from a dll made with .NET (C#)
2. from a program written in plain (as in: not .NET) C or C++?


This is way off-topic for c.l.c. Portable C code knows nothing
about classes, typelibs, dlls, .NET, etc. c.l.c deals only with
portable code that can execute on any system with a standards
compliant compiler system. F'ups set.

--
"If you want to post a followup via groups.google.com, don't use
the broken "Reply" link at the bottom of the article. Click on
"show options" at the top of the article, then click on the
"Reply" at the bottom of the article headers." - Keith Thompson
Nov 14 '05 #78

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

23
by: Fabian Müller | last post by:
Hi all, my question is as follows: If have a class X and a class Y derived from X. Constructor of X is X(param1, param2) . Constructor of Y is Y(param1, ..., param4) .
35
by: hasho | last post by:
Why is "call by address" faster than "call by value"?
13
by: Bern McCarty | last post by:
I have run an experiment to try to learn some things about floating point performance in managed C++. I am using Visual Studio 2003. I was hoping to get a feel for whether or not it would make...
4
by: John | last post by:
Hi all, This really is quite an urgent matter. I have a page with multiple, dynamically-loaded user controls and when a user clicks on a button, the whole form is submitted. Now at this stage...
5
by: Amaryllis | last post by:
I'm trying to call a CL which is located on our AS400 from a Windows application. I've tried to code it in different ways, but I seem to get the same error every time. Does anyone have any clue...
13
by: mitchellpal | last post by:
i am really having a hard time trying to differentiate the two..........i mean.....anyone got a better idea how each occurs?
13
by: shsingh | last post by:
I have a class A containing some map as data variables. I creat an object of class A on heap by allocatiing memory by using "malloc". This will return me the required memory but the object is not...
3
by: cberthu | last post by:
Hi all, Is it possible to have two connects in the same rexx script to different DB's? I have to get data form on DB (with specifics selects and filter out some values with RExx) and save the...
9
by: CryptiqueGuy | last post by:
Consider the variadic function with the following prototype: int foo(int num,...); Here 'num' specifies the number of arguments, and assume that all the arguments that should be passed to this...
12
by: Rahul | last post by:
Hi Everyone, I have the following code and i'm able to invoke the destructor explicitly but not the constructor. and i get a compile time error when i invoke the constructor, why is this so? ...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.