Calling PythonFunction's From A VB Application Hosting Iron Python

Apr 17, 2012

I'm a C++ programming who was tapped to write a small application in Visual Basic. The application hosts an IronPython runtime and I am attempting to define some function in python and then call them from VB. I have written a simple test function in python

def test():
print "Test was Called"

Then I use the iron python to create a ScriptSource from the python file. I am able to look up the "test" variable through object operations but I can not figure out how to call the object that. For example (in VB):

pyScope = engine.CreateScope()
pySource = engine.CreateSourceFromFile("C:SomeFilepath est.py")
pySource.Execute(pyScope)

[Code]....

I am able to call the function and I see the expected output at stdout. I am still under the impression that there is some function-pointer-like type that I can cast objects of type PythonFunction to which will let me invoke temp directly without calling to the Python engine.

View 2 Replies


ADVERTISEMENT

Calling Dll In Python?

Sep 1, 2009

I have a function in vb that is converted to a dll that I want to use in python. However trying to use it, I get an error message this is the VB function

Function DISPLAYNAME(Name)
MsgBox ("Hello " & Name & "!")
End Function

and this is how I call it in python

from ctypes import *
test = windll.TestDLL
print test
print test.DISPLAYNAME("one")

But I get errors so what is the right way of calling the dll

Traceback (most recent call last):
File "C:Test estdll.py", line 4, in <module>
print test.DISPLAYNAME("one")

[code].....

I have been looking around online but no solution so far. Can't use cdll since this is for c progs.

View 3 Replies

Hosting .net Code Within An Application?

Nov 30, 2011

I want to allow the end user to write vb.net code within my application that will interact with my application and database. I have seen software like this, such as GE iFix, Excel, and others.

View 2 Replies

Run A Python Script Inside A Application

Apr 17, 2011

I am trying to run a python script inside a vb.net application, which means executing the code inside vb.net instead of runing it external. The problem is:

I am using MsScriptControl and set the language to "python", I tried to run it and get the error "A script engine for the specified language can not be created". My research has told me i need these keys in my registry. The problem is I cant find them so how to I make them. Or even better a full solution to my problem.

View 2 Replies

VS 2008 Create An Application Using .NET Which Will Import Python Object?

Sep 8, 2010

I am trying to create an application using VB.NET which will import python object.

View 4 Replies

C# - Calling A Method In A FACTORY Class When Application Is Closed / Disposed Without Using Application's Dispose() Method

Mar 28, 2012

I am indifferent if you are a VB.NET or C# or other .NET developer. I have a FACTORY class like the following:

[Code]...

View 2 Replies

.NET Application Hangs When Calling DLL

Dec 28, 2010

Its been running in production for over a year and this is the first time I saw this behaviour. The application is a VB.NET Console Application which is triggered by MQ server. This application uses a class library which is part of the same project(Say 'abc.dll'). In production around 40+ instances of this exe are running and all of them use the some of the functions from 'abc.dll'.

Last week, we noticed that all the 40 instances were shown to be running in the task manager but they were not doing any activity. There was no exception thrown or error logged in Application logs or System logs. To frantically debug the problem, I tried isolating the problem.

With all these 40+ exes hung up, I wrote a small aplication which would use a reference to this 'a.dll', create an object of one of the classes in that dll and execute a method in there. I was printing console.writelines in between to see to which point it gets to before erroring out.

To my surprise, I found that at the point where I was creating an object of a class in 'a.dll' this sample test application would also hang just like the others. No exceptions thrown. So I killed all those applications as a last resort and then when I restarted all of them, everything worked fine.

I couldn't find any explanation for this behaviour. Since it was a critical error affecting a production system(blanking out the application for 3+ hours), I have to give a very good explanation as to why this would occur. how it can be prevented in future.

(Side note: the servers running these appilcation do not have a maintenance schedule and are supposed to be up for couple of months together.

View 11 Replies

Application Calling Fortran Exe

Nov 18, 2010

I am running one fortran exe in .net application(calling from command line with the help of system diagnostic process). If we directly click on fortran exe, it shows inputs to enter for fortran in command window, after input entered it gets executed. We want same behaviour but want to run fortran exe from .net application, If we click on button in vb.net form, this exe should get called and should show inputs to enter on the command line, once inputs entered it should execute. How to achieve this with .net application? Right now, after clicking on button in vb.net form, exe get's opened in command window, but it is blank, and gets hanged. [code]

View 1 Replies

Calling Another Application From Within A VB Program?

Feb 9, 2011

I have written a VB Program for calculating Power requirements for Heating Water, Air etc. There are some standard formulae, which require inputs in fixed units. The user may have data in other units, which will then need conversion.Example: Formula needs Airflow in Cubic Meters/ Minute, where as user has data in Liters/Second.I do not want to write code to do Unit Conversions from within my Program. There are readily available FREE Applications for doing the conversions. I have one such Application, which I want to bundle with my VB program.How can I Code in my program, so that when the user clicks a Button " Unit Conversion ", the bundled program will open.This is like clicking on a Hyperlink in a Program or Document and a Web Browser opens.

View 1 Replies

Calling Asp.net Function Within Web Application?

Oct 26, 2011

Is it possible to call a function within an asp.net web application from outside that application e.g. with VB.net? If so it would be great to see a hello world type example.

For arguments sake lets say I have my function "helloworld" in a class file within web application: [URL]

My ultimate goal is to enable some reliable / robust scheduling of functions within asp.net. I have read multiple examples about using web services / custom services running on the server etc but I don't really get the implementation.

View 2 Replies

Calling IBM UniVerse Application?

Dec 9, 2010

I have developed IBM UniVerse application before. Now I am developing a .NET application that I want to call the UniVerse application?

View 1 Replies

Calling JS Function From Application?

Jul 6, 2009

I am working on an desktop application in which I am using WEB BROWSER component. There is a Javascript function within the webpage I want to call from my vb.net application. I am not attaching any code with this post because I couldn't find anything relevant on internet as all example involve asp.net server controls, no VB.Net desktop Application example.

way out to call JS function of the webpage loaded in the browser component through VB.Net Form Button.

View 1 Replies

Get GUID From Calling Application?

Nov 29, 2010

I have multiple applications that will be calling a DLL.Is there a way to get the GUID from the calling application without passing it?I would like to use the GUID to verify the parent application and open up rights within the DLL for a specific app but not others.

View 3 Replies

Calling A Method From .dll Globally In C# Application

Aug 26, 2009

I am using a .dll called Kiosk in my application which is resonsible for disabling some keyboard keys. I am doing like this... using Kiosk; public static Kiosk.Kiosk KIOSK = new Kiosk.Kiosk();

[Code]...

View 2 Replies

Calling Some Default Windows Application

Jun 3, 2011

If I wanted to call the RUN prompt and the Command prompt in my application, what exe's would I need to reference?

View 6 Replies

FTP Or Other File Hosting

Dec 16, 2009

I posted a while ago asking how to manage correlative updates: url...I made that post under the assumption that the direct link i had in place (an attachment on a google site) would not change. Unfortunately I overlooked the fact that google sites use redirect links, just a hair short of direct links. I've heard of FTP Protocols and noticed threads in the c# sections on how to code them, but I don't know much about them. I really need an internet access link for my pgroam to download the file from and am not sure on what the best approach is to this problem. Please advise...I seek not answers, but understanding, that I may not solve, but learn.

View 2 Replies

.net - Calling New StackTrace Blocks When Closing Application

Sep 12, 2011

I just did some analysis by using a global function which is called GetCallingMethod in my case.

Mostly it works great. But some cases the application is blocked. It is blocked when closing the application. When going to "pause" in Visual Studio, it stays on the new StackTrace line forever.

In my application I am using third party references, multithreading and several classes. But all that should not be a problem and should not lock the tracer class as far as I imagine. I am using Visual Studio 2010 Ultimate in this case.

This line will never be left in development area. Application will is frozen. Try/Catch will not force the procedure.

View 1 Replies

Application Crashes When Calling Embedded Resources?

Jul 3, 2009

I'm writing a console application in Visual Basic 2008 Express. I added several text files to my project as resources. Specifically... I went to my project's "Properties" page and selected the "Resources" tab. I clicked the "Add Resource" dropdown and chose "Add New Text File". I entered some simple text and saved the file as "Welcome.txt". I built the entire solution.n my code, I use console.writeline(My.Resources.Welcome) to display the text

View 1 Replies

Calling A Function That's In A Module In External Application

May 25, 2012

I have an application (app.exe) that has a VB Module in its source code (Module1). The module has a function called Function1. I need to call this function from another application. The module is not marked as public, so adding a reference to app.exe won't work. I'm trying to use reflection (Assembly.LoadFrom()) but unless I'm way off base, the module would have to be a class in order for me to get an instance of it.

Please nobody ask me "what have you tried?" I tried a million different things and let's just say "none of them work." So I'm looking for someone that has specific experience with doing exactly what I'm trying to do. If you don't have that experience, please move on to the next question and ignore mine.

View 1 Replies

Calling Another Application And Activating Its Menu Click?

Nov 2, 2006

it is possible to code to a call another application and activate its "Tool" menu click.I am enclosing sample exe (this is the application that has to be called; and its "Tool" menu has to be acitivated, which fires a messagebox event")

View 39 Replies

Calling Javascript Function From Within Desktop Application?

Jun 24, 2009

I'm trying to do something which i am not sure is possible, im hoping someone will be able to prove me wrong.I have a desktop application written in VB .net which needs to post to google analytics, the interface they provide is javascript based. At the moment my application opens an internet browser, goes to a specified URL which in turn executes the javascript contained within, this is cludgey and memory gobling!

Is there any way of importing a javascript file and calling a javascript function without opening a third party browser? would preferably not want to use the browser control either.Is there a way of instantiating for instance a javascript engine and passing it the commands?

View 2 Replies

VB: Get Compiled DLL's Calling Application Info; COM Security?

Oct 15, 2010

Through COM, one can potentially gain absolute control over a target system. For example: using javascript's ActiveXObject object in IE, one can create certain objects which were designed to have direct access or interaction with system properties and files.One would think common sense dictates users disable ActiveX features in IE immediately after installing the browser to ensure their system is protected while surfing the net, or at least paying close attention to which websites they permit. But, I doubt many average PC users know how or why to do this, or just get tired of mirco-managing it over time. I think any PC user or admin my COM class caters to would greatly appreciate not having to deal with that. Thankfully it looks like IE versions come packaged with ActiveX disabled by default nowadays.

I've built a very versatile COM class library in VB. I didn't intend for it to be callable from any website, but that feature is just part of the COM platform. I'd like to prevent the library from being called from IE unless the website is on a white-listed domain to proactively protect the user (and ultimately their entire intranet) from harm from malicious websites. What would be the best method in VB.Net to tell which application called my DLL, to be able to tell if it was called from any command or process originating from IE? And, what domain called my dll? System.Environment.GetCommandLineArgs()(0) gets me the calling application path. With this info, I can compare it to a black/white-list of applications.

View 2 Replies

C# :: Hosting IE 8 In WinForms And Opening A PDF?

Apr 30, 2009

We have a form that hosts the WebBrowser control. That is the only control on the form.We pass the form the file path of a temporary PDF file and it does:WebBrowser1.Navigate(Me._PathToPdf)When the form is closing, it navigates away from the PDF file:

WebBrowser1.Hide()
WebBrowser1.Navigate("about:blank")
Do Until WebBrowser1.ReadyState = WebBrowserReadyState.Complete

[code].....

View 4 Replies

Hosting A WCF In Windows Services

May 10, 2011

I have a working WCF, it is written in VB. I need to host it in Windows Services on a remote server. I cannot use IIS (they uninstalled after I had it installed). Specs are to host in Windows Services, the only way I can get around that is to quit.

[Code]...

View 1 Replies

Hosting An Asp Website On EasyCgi?

Nov 24, 2010

I have developed a website using ASP.NET/VB + SqlServer 2008 and Dotnetnuke CMS.Now I have to host it on easycgi.com I have some questions:How should I restore my db (unfortunately easycgi supports just sqlserver 2005) so what should I do to convert my db to 2005?and what should I do to host my website (step-by-step "please").

View 1 Replies

Hosting Of WCF And Windows Services?

May 9, 2011

I've created a WCF service and, with help of others from this site and the department I work in, the WCF service is running as a service on my development machine. Tested it with a console app and it works.But, it's not supposed to be on my development machine. It needs to be on a different server.This is difficult because the server it is supposed to reside on DOES NOT have Visual Studio installed on it.So I cannot run the VS 2008 Command Prompt with installutil to run the WCF service as a service on that server.

View 3 Replies

IDE :: Calling WebHelp From Application And Displaying Table Of Contents?

Oct 28, 2010

In my vb.net application I call the main page of WebHelp using

System.Diagnostics.Process.Start(

[URL]

The web page displays just fine, but the Table of Contents, Index tab and Search tab do not display at all.How do I get them to show when calling help from vb.net?

View 1 Replies

VS 2010 Calling An External Application And Setting Focus On The Same?

Oct 8, 2010

I am wondering if it is possible to call an application, say "notepad.exe" (among other application's that are already open) and setting focus on the same, so the user can readily start working on it.

View 6 Replies

Chat (Using Socket) Server In Web Hosting?

Nov 29, 2011

Read this: [URL]. Now the question: I want the client will connect to web server (or web hosting).

View 8 Replies

Hosting Winform User Control In IE8?

Apr 11, 2010

I have a Winform UC packed in a CAB and hosted in an aspx web page using the <object> tag. In IE7, things work. But in IE8, no matter what settings I choose, the control never gets installed. I need to point IE8 to the CAB, download it, unpack it, and run the installer in the client machine, outside IE8. The UC is fairly complex, and requires several DLLs (third party components). The control reads data from hidden fields in the hosting page, and calls javascript functions on the page.

View 4 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved