Re: [Mono-dev] mono embed: passing arrays from and to unmanaged code

2006-01-13 Thread Davide Morelli


thank you, that was really useful!

now my problem is that i'd need to pass an array of struct.
a very simple struct like this one

- in C
typedef struct atom_simple
{
int a_type;
float float_value;
MonoString *string_value;
};

- in C#
[StructLayout (LayoutKind.Sequential)]
public struct Atom
{
public int type;
public float float_value;
public string string_value;
}

I'd like to put those struct in an array but i need a MonoClass to create 
the MonoArray, something like:


MonoClass *c = mono_class_from_name (image, PureData, Atom);
mono_array_new (domain, c, argc);

but is this the right thing to do? i mean does mono_class_from_name () work 
on struct also?

if not, is there another way i can create a monoarray ?

sadly the examples in samples/embed don't cover this.

thank you,
Davide.


- Original Message - 
From: Paolo Molaro [EMAIL PROTECTED]

To: mono-devel-list@lists.ximian.com
Sent: Thursday, January 12, 2006 4:48 PM
Subject: Re: [Mono-dev] mono embed: passing arrays from and to unmanaged 
code




On 01/11/06 Davide Morelli wrote:
I'm trying to pass arrays of floats and strings from and to mono embed 
from

a C software with no luck.

I'd need to call (from C) managed functions like:
void TakeManyStrings(string [] list);
void TakeManyFloats(float [] list);

i'd also need to do the same from managed to umnanaged: call a C function
from C# passing an array of strings and floats.

I couldn't find any useful manual page or source code on how to do so..
could anybody point out any reference to me?


See mono/docs/internal-calls.
An array argument passed to an icall will look like a MonoArray*
argument on the C side.
A MonoArray* is a reference so it is passed to managed functions like
any other reference. See mono/samples/embed/*.c for many invocation
examples.

lupus

--
-
[EMAIL PROTECTED] debian/rules
[EMAIL PROTECTED] Monkeys do it better
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list



___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] SUSE Linux / Installing mono_mod problems

2006-01-13 Thread Joe Audette
I think I have just the tutorial you're looking forhttp://www.joeaudette.com/buildingmonoforaspnetThe error you are getting is because you don't have the appache dev stuff, theres a link to get it in the article.Cheers,Joejoe_audette [at] yahoo dotcom http://www.joeaudette.com http://www.mojoportal.com- Original Message From: S. Shawn Mehaffie [EMAIL PROTECTED]To: mono-devel-list@lists.ximian.comSent: Friday, January 13, 2006 9:08:01 AMSubject: [Mono-dev] SUSE Linux / Installing mono_mod problems   I am using the SUSE Virtual Machine to see how mono works. I have installed mono, and have dow
 nloaded and unzipped the mono_mode. When I try to run the following command ./configure --prefix=/usr to configure the mono mod so I can compile / install it I get the following error: apsx was not found, DSO compilation will not be available. Any help will be appreciated. I think I need to install something else, but not sure what. I used the installation package to install mono, so I was surprised that the mono mod was not installed since it is required for the ASP.Net functionality to work.I am a new Linux user and am very interested in mono and making sure my ASP.Net applications that I write also run under mono. Please be as detailed as possible in any instructions given.<
 /span>I am also interested in any instructions on using the "Automatic configuration of ASP.NET applications with mod_mono"Any help will be appreciated.Thanks  S. Shawn Mehaffie  ___Mono-devel-list mailing listMono-devel-list@lists.ximian.comhttp://lists.ximian.com/mailman/listinfo/mono-devel-list___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] mono embed: passing arrays from and to unmanaged code

2006-01-13 Thread Robert Jordan

Davide,


- in C
typedef struct atom_simple
{
int a_type;
float float_value;
MonoString *string_value;
};

- in C#
[StructLayout (LayoutKind.Sequential)]
public struct Atom
{
public int type;
public float float_value;
public string string_value;
}

I'd like to put those struct in an array but i need a MonoClass to 
create the MonoArray, something like:


MonoClass *c = mono_class_from_name (image, PureData, Atom);
mono_array_new (domain, c, argc);

but is this the right thing to do? i mean does mono_class_from_name () 
work on struct also?


Yes. After you've allocated the array, you can fill it up using
the mono_array_* macros declared in metadata/object.h.

Robert



if not, is there another way i can create a monoarray ?

sadly the examples in samples/embed don't cover this.

thank you,
Davide.


- Original Message - From: Paolo Molaro [EMAIL PROTECTED]
To: mono-devel-list@lists.ximian.com
Sent: Thursday, January 12, 2006 4:48 PM
Subject: Re: [Mono-dev] mono embed: passing arrays from and to unmanaged 
code




On 01/11/06 Davide Morelli wrote:
I'm trying to pass arrays of floats and strings from and to mono 
embed from

a C software with no luck.

I'd need to call (from C) managed functions like:
void TakeManyStrings(string [] list);
void TakeManyFloats(float [] list);

i'd also need to do the same from managed to umnanaged: call a C 
function

from C# passing an array of strings and floats.

I couldn't find any useful manual page or source code on how to do so..
could anybody point out any reference to me?


See mono/docs/internal-calls.
An array argument passed to an icall will look like a MonoArray*
argument on the C side.
A MonoArray* is a reference so it is passed to managed functions like
any other reference. See mono/samples/embed/*.c for many invocation
examples.

lupus

--
-
[EMAIL PROTECTED] debian/rules
[EMAIL PROTECTED] Monkeys do it better
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list



___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


[Mono-dev] AJAX problem with Mono

2006-01-13 Thread Webmaster








Hello all,



I am having some problems installing AJAX in conjunction with Mono. Everything
seems to have went well up until I tried to call a serverside _javascript_
function. I got an error saying object undefined. I then tried to navigate the
SRC of the apparently created _javascript_ include, and there was nothing. I got
an error saying file not found. 



I think I configured my http handlers correctly, at first I was
placing the app in the subdirectory of another Mono app, and so changed it to
its own space on my server. Still generated problems. Ajax is either creating the files and placing
them where I cant see them, or its not creating them at all.



I followed the instructions that came with AJAX implicitly and I am still having
problems. Can AJAX
even be installed on MONO? Does anyone have any success stories?



I know I am calling the registerAjax function properly,
because I get the output in my source. I just cant see where the outputted JS
files are being place.

Another thing too, is AJAX
supposed to place the JS include code right before a FORM object or in the
head? It outputs the JS include right after a form element, could this be a
problem? 



Any help would be greatly appreciated.



Best Regards



Martin Tuncaydin

[EMAIL PROTECTED]








___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] System.Web.UI/HtmlTextWriter.cs issue

2006-01-13 Thread Gonzalo Paniagua Javier
On Thu, 2006-01-12 at 14:09 -0500, Ben Maurer wrote:
  In this case the return chk(); will be added to the onclick event in
  addition to the validation code there.
 
 1) you should not use .ToLower to do case insensitive compares, but
 String.Compare. Also, you must use the invariant culture.
 
 2) Why would attrName (or the others) ever be null or empty
 
 3) Is onclick the *only* attribute that this happens to?
 
 4) Some of the microsoft code seems to add semicolons for you at the end
 of js statements if you don't. Does this one do that too
 
 5) No patch should ever be made without test cases.

After Ben's Five Commandments, I have this bug here that will probably
be fixed with this patch:

http://bugzilla.ximian.com/show_bug.cgi?id=76974

-Gonzalo


___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


[Mono-dev] Bug 77242

2006-01-13 Thread Robert Jordan

Hey,

This one http://bugzilla.ximian.com/show_bug.cgi?id=77242
might be important to get fixed in the 1.1.13 branch as well.

The ResourceManager's lookup methods are not falling back
to the invariant culture if the current culture != invariant culture
and if the key was not found in the current culture's resources.

Robert

___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] timer locks up interface..

2006-01-13 Thread Giovanni A. D.
Thanks Michael and Felipe for your help; I'm going to try it.

Also the Idle Handlers thing is something I never heard about and
sounds cool :-)

bye,
Giovanni.
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] timer locks up interface..

2006-01-13 Thread Giovanni A. D.
It works! :-) thanks again.
here is the code, just in case it could be useful to someone else..

-
using System;
using Gtk;
using Glade;

public class GladeApp
{
public static void Main (string[] args)
{
new GladeApp (args);
}

public GladeApp (string[] args)
{
Application.Init ();

Glade.XML gxml = new Glade.XML (null, gui.glade, window1, 
null);
gxml.Autoconnect (this);

button1.Clicked += OnClickButton1;  
button2.Clicked += OnClickButton2;  

timerSetup();
startTimer();
Application.Run ();
}

Int32 timecnt;
bool stopTimer; 

[Glade.Widget]
Button button1;

[Glade.Widget]
Button button2;

[Glade.Widget]
Label label1;   

// Connect the Signals defined in Glade
private void OnWindowDeleteEvent (object sender, DeleteEventArgs a)
{
Application.Quit ();
a.RetVal = true;
}


private void OnClickButton1 (object o, EventArgs e)
{
Console.WriteLine(Start);
startTimer();
}


private void OnClickButton2 (object o, EventArgs e)
{
Console.WriteLine(Stop);
stopTimer=true;
}   


private bool doGlibTimer()
{
Console.WriteLine(- timer - +timecnt.ToString());
label1.Text=timecnt.ToString();
timecnt++;

if (timecnt  10) {
timecnt=1;
}

return !stopTimer;
}


private void timerSetup()
{
timecnt=1;
stopTimer=true;
}


private void startTimer() {
my_timer.Elapsed += new 
System.Timers.ElapsedEventHandler(doTimerClick);

if (stopTimer) {
stopTimer=false;
GLib.Timeout.Add (1000, new GLib.TimeoutHandler 
(doGlibTimer));
}

Console.WriteLine(Timer setup OK);
}

}
-

bye,
Giovanni.
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] timer locks up interface..

2006-01-13 Thread Giovanni A. D.
as you may have guessed.. while copying and pasting i forgot to delete
a line :-P
(hehe.. getting tired)

( this one:
my_timer.Elapsed += new System.Timers.ElapsedEventHandler(doTimerClick);  )

bye,
Giovanni.
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


[Mono-dev] XSP warning

2006-01-13 Thread Carlos Solorzano
XSP is all of the sudden going crazy for us. All we did is upgrade  
mono and XSP to 1.1.13.0 and now it keeps printing out this warning  
constantly that it never printed before:




** (/usr/local/lib/xsp/1.0/xsp.exe:15518): WARNING **: icall.c:1020

** (/usr/local/lib/xsp/1.0/xsp.exe:15520): WARNING **: icall.c:1020

** (/usr/local/lib/xsp/1.0/xsp.exe:15518): WARNING **: icall.c:1020

** (/usr/local/lib/xsp/1.0/xsp.exe:15515): WARNING **: icall.c:1020

** (/usr/local/lib/xsp/1.0/xsp.exe:15518): WARNING **: icall.c:1020

** (/usr/local/lib/xsp/1.0/xsp.exe:15515): WARNING **: icall.c:1020

** (/usr/local/lib/xsp/1.0/xsp.exe:15518): WARNING **: icall.c:1020

** (/usr/local/lib/xsp/1.0/xsp.exe:15515): WARNING **: icall.c:1020

** (/usr/local/lib/xsp/1.0/xsp.exe:15515): WARNING **: icall.c:1020

** (/usr/local/lib/xsp/1.0/xsp.exe:15518): WARNING **: icall.c:1020

** (/usr/local/lib/xsp/1.0/xsp.exe:15515): WARNING **: icall.c:1020




Does anyone know whats going on?

--Carlos

___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list