Creating A DLL That's Callable From A Legacy C Environment
Sep 21, 2010
I need to create a DLL that's callable from C, that executes database queries and returns results. The first tool I reached for was VB, and I found it easy to create a DLL, but when I view the DLL using dumpbin /exports, I don't see any functions.
So, my questions:
1) Is VB the right tool for the job? If not, (The ideal solution would be a 3rd-party DLL that will let me do database queries -- a friendly higher-level wrapper above ODBC. I've searched around and come up empty, but maybe I haven't looked in the right place).
2) If VB is the right tool for the job, how do I export a class method so that it's callable as a function in a legacy C environment?
More details:
1) The target environment is Mercury Loadrunner VUGen. It's able to import DLLs and make function calls, but the environment is (non-.NET) legacy C.
2) My development environment is MS Visual Studio 2008
View 2 Replies
ADVERTISEMENT
Jun 6, 2011
I have written a data analysis program and I want to keep a list of recently accessed data files. I have kept this list in a text file in the same directory as my .ese file which is installed in a subfolder in my programs folder. But in Windows 7, it is not possible to write to files in the programs folder without assigning privileges to that folder which I found confusing to do. I would rather not subject clients to this process. It seems like a good place might be in one of the user folders. But I have no idea of how to go about establishing a path to such a folder in code. I thought it might be possible to identify an environment path such as %userapps% or some such thing that would work in both Windows XP, Windows Vista, and Windows 7. I would also like to generate a .log file in the same directory to aid in debugging.
View 3 Replies
Dec 17, 2009
I have a solution which contains among other things a project which is COM callable.
I would like to put some breakpoints into this and step through it but VS tells me "The breakpoint will not currently be hit".
how I can step into a com callable?
View 1 Replies
Dec 1, 2009
This is a dumb question, but I just cant find an answer. I want to do something as simple as this in IronPython, something I did in asp.net vb.net to capture the id of a table displayed in a gridview or datagrid
iid = e.Item.Cells(2).Text
But I get "Tablecellcollection is not callable".
View 1 Replies
Sep 25, 2009
I have a project as part of my Windows Solution which is COM callable and auto registered when I run my application.
After running my Windows application I run a VB 6 application which references my com callable assembly.
I would like to step into this code but my breakpoints aren't hit at all.
View 2 Replies
Dec 15, 2009
I have VB6 Dll which I am referencing in vb.net ,I am calling the following function in it. It working fine in developemnt environment but not in deployement environment.
Error Method not found: 'Boolean MyUtils._MyUtils.LoadMyObjectRecords(ADODB.Stream ByRef, System.Array ByRef)'.
View 4 Replies
Oct 14, 2010
I need to call functions of "well documented" C++ dlls from a VB6.0 application. how to create VB6.0 callable C++ wrapper.
View 3 Replies
Mar 9, 2009
I have been writing a COM callable assembly for my current solution allowing unmanaged code some access. I have just been told that I can now start using 3.5 of the framework having used 2.0 for some time.I then came across WCF and was wondering if I could use any of this to create my application api and allow access from anmanaged code.
View 1 Replies
Jul 13, 2009
I have created a COM callable assembly which consists of an Interface, a single class which implements the interface. In this case the implementation is a single method.I have registered the assembly, created a type library and added the assembly to the GAC.I thought about opening an Office application like WORD or EXCEL 2003 and trying it from there but beyong referencing the COM assembly I have no idea how to code it.
View 1 Replies
Sep 6, 2009
My windows application needs to raise an event in a COM callable assembly so unmanaged code can pick up on the event.I am sick of this. All the crazy tags required for COM callable is doing my head in.
View 1 Replies
Nov 18, 2009
Public Const COLUMN_MODEL_ORDER As String = MDL_ORDER.ColumnName
DataModel.Config.DefaultView is a System.Data.DataView
how can I convert it?:
Dim ModelOrder As Integer = 1
Dim DataModel As New ProfileDataModel(New DBConnection, Me.ProfileID)
If DataModel.Config.DefaultView.Count > 0 Then
[code]....
View 5 Replies
Apr 28, 2010
I have a list of color values encoded as signed integers (OLE I think) in a legacy INI file that I need to translate into (A)RGB values with .NET. [code]...
gives an alpha-blended version of a color that is not at all what I expect. I think that a value like -2147483633 is supposed to represent a system-defined, or named color like ButtonFace. Is there a .NET method for translating these legacy colors properly? Note that pInvoke to OlePro32.dll is not an option.
View 1 Replies
Jul 6, 2011
I'm building an c# app that is designed to replicate and enhance the functionality of an VB6 app developed many years ago. My problem is that one module in the old app does some realy complicated things and trying to replicate this starting from specs would be a big pain for me. Even if this sounds like the best idea.
My question is : is there a way i could keep the old VB module and integrate it into the c# app, so that i wouldn't have to rewrite everything ?
View 6 Replies
Jul 31, 2009
Whats the best way to add an adornment layer to legacy controls, or in other words you know jetbrains refactoring tools, how do they draw the squiggly lines under incorrect text? Also on another note can one draw said adorments on controls not under the direct reference of the application, ie using a handle? If you have insights, or just theories,
View 1 Replies
Jan 8, 2010
I am looking for a utility/tool to convert calls to legacy VB6 functions to the .NET equivalent. For example, it would convert this...
[Code]....
Does anybody know of one, or am I going to have to roll my own?
View 3 Replies
Sep 7, 2009
I have an old application in BASIC. It still runs under Windows ME. It no longer works under XP, so I was looking at recoding the applciation. I started coding it in VBA, which I have used for Excel macros for years.
We are looking at getting a new computer for kids to use for schoolwork, etc. I also want the kids to learn programming and recoding my old BASIC application is a good place to start. A new computer we were considering has MS Works, but I suspect I will need MS Office (at least Excel) to get VBA. There are multiple versions of Office 2007 (Home & School, Small Business, Pro), so I looked into the Microsoft website to see if I could find out what version of Office I need to get to have VBA. What I found is that VBA seems to be going away in favor of VSTA and VSTO.
Is VBA truely going away? Or is it still going to be a part of Excel for wrting macros? If VBA is part of Excel, is it available in all versions of Office? If VBA is going away, what is recommended for recoding my old BASIC application?
The application involves display of a screen full of data with color coding and has several actions for updating those data.It does not involve any graphics or animation. In the old BASIC application all the system data and runtime data are in program variables.
The actions to be performed are selected by number from menus.In creating the application in VBA, I envisioned primary data display on a main form, which would also have buttons to invoke dialog panels to perform the various updating actions.I have the system data that are not changed when the application is run in one Excel worksheet and the runtime data on another worksheet.
View 2 Replies
Jan 3, 2012
When was isnumeric considered legacy code? I guess all that i have learned from my college class last semister is legacy.
View 4 Replies
Sep 1, 2010
Hint: this one might sound complicated, because I am trying to give as much info as possible, but I suspect that I just want someone to tell me "yes, you are correct".On this legacy system, which dates from 2002, the user visits a web page and uses an RFID reader to read a tag number, which is then written to an input field on the web page.
The only s/w that comes with the reader is a custom DLL, nop .exe. The very sparse documentation insists that only MSIE be used and that all security relating to ActiveX be disabled.When I look into the source of the web page I see calls to functions in the DLL.Now, here's the fun part: I know zilch about ActiveX, I have to make a minor change to the DLL _but_ the VB6 source code has been lost, so I guess that I have to recreate the (seemingly very simple) DLL from scratch - this week.
Decompiling the DLL shows me the functions (locateReader, getTagVal, closeReader). However, by decompiling I can't really know the number or type of the parameters, nor the return values ... and if anyone knows the API they are refusing to share it, but basically it all seems to have been lost in the mists of time as companies went bust, were bought & sold, merged & demerged and the initial DLL might have been written by an external guy, but no one knows who.So, can I get the function params & type from the ASP page source?I see things like
Reader = new ActiveXObject("<dllName>.Reader");
Reader.locateReader();
tagVal = Reader.getTagVal();
Reader.closeReader();
I would say that none of the fn()s take parameters, that closeReader doesn't have to return anything; it looks like locateReader doesn't return anything either, so I guess that error handling will have to be in the DLL (loop forever with a popup demanding that a reader be attached; and getTagVal seems to return a string.
View 1 Replies
Jan 21, 2012
I've looked up ways to reduce the ViewState:
Viewstate Optimisations
Strategies for reducing ViewState size in asp.net
However, due to the situation I'm in, I need the quickest and most effective ways to reduce the ViewState size. The legacy system I'm working on is bloated and routinely has a ViewState that's 800Kb+ on multiple postbacks.
For example, I'm pretty sure populating drop down lists with 100+ items on multiple post backs is one of the culprits, correct?
Disabling the ViewStae entirely doesn't appear feasible. It breaks all of the controls, of which there are many, rendering the pages unusable. If this is the best approach, how should I go about handling all the broken controls?
View 4 Replies
Jul 8, 2009
I have an old VB6 program which copies data from a legacy system (Btrieve 6) into our SQL Server so it can be served up on the web and used to feed some of our other needs. The legacy system outputs a file and a feed program posts it into the legacy ODBC database. The program isn't anywhere near realtime and I am now finding the delay between data going into the legacy database and then into the SQL database is becoming unacceptable so I thought I'd look at VB.NET and see if I could find a better way of doing it using FileSystemWatcher so that when the legacy output file is renamed I can then start a copy of the record affected from the legacy to the new database.
[Code]...
View 1 Replies
May 13, 2011
I am trying to get a legacy vb.net application up and running and I need DSOleFile.dll.
View 1 Replies
Jun 24, 2009
I downloaded nUnit and TestDriven.net. I have a legacy Web Site application and I would like to implement some unit testing. I created a class in the app_code folder and added Imports NUnit.Framework etc... After writing a basic test, I get the "Can't execute tests in 'Web Site' application." error. I guess the Web Site project is not supported. Converting to a Web Application is not an option at this time. I have Visual Studio Test Edition, so I tried that route. I created a test project, wrote a couple tests in my test class etc... only to find out I cannot reference the classes in the app_code folder of the Web Site project.
View 2 Replies
Aug 20, 2010
I have a legacy application that has an interactive graphical user interface, but also periodically checks for files in a directory and reacts to the files. I want to launch the application from a VB program, but not see the GUI (i.e., just let the file interface do it's thing). I really don't want to see the application running on the desktop at all (e.g., no windows, nothing on taskbar), the only evidence would be if I checked task manager I'd see it running.
Obviously this app would be ideally a service, but that's not where we are and I can't change it so I'm trying to simply not see the GUI.
I've seen the ProcessStartInfo.CreateNoWindow and WindowStyle = hidden flags but they don't hide the GUI of the legacy app.
again launch the legacy app (actually an unmanaged C++/MFC app) from a VB managed admin app.
View 4 Replies
May 21, 2012
I've got an old legacy application for communicating via serial port to an embedded controller communications bus. that someone else developed.The application is written in VB6, and is structured as two projects - a DLL to handle the connection and communications logic, with an application GUI project.I was hoping to be able to write a new application GUI (in C++ ideally) to use the existing DLL as-is, but I'm having lots of problems working out how to import it.So I'm wondering, is it even going to be possible to use this old DLL into a C++ project as is? or is it possible to import into a C# project? or a VB.NET project? (would prefer not to use VB, but can if I have to)Where I am now: I have the existing compiled executable and DLL, and these run on my system.I also have the project files, and they're all readable in notepad++ but I don't have VB6, and importing the project into visual studio VB.NET 2008 express isn't at all straightforward. Especially not without a working example to dig through and play with first (DLL project may be importable, but has 50+ things indicated as needing changing in the upgrade report. It also seems to be ignoring three .cls files that look very important to my not particularly VB6-savvy eyes... The application project has a message in the upgrade report about something "missing a design time license" and the only project files that actually seem to come into the project explorer for imported project is the project file itself, and the assembly info file.)
Most examples of how to import a DLL into VS C++ assume you have a solution with the DLL project all compiling nicely alongside your project that will use it. Or at least a .DLL and .lib and .h file... I spoke with the original developer of the code (in another city, we don't work directly) and got a .lib to match my .dll, but still have no .h file.I'm usually fine to bash through something new, but without a baseline working example of the project even in VB6 that I can get my understanding from, it makes this very hard. Also a lack of similar questions anywher google can find them on the net makes me wonder if this is something i should be even attempting.I'm working on getting a non-express copy of visual studio if that will make any difference (express worked fine for everything up until now so I never needed anything more) but that will take a number of weeks, most likely.
View 1 Replies
Apr 4, 2011
I'm converting a project from .net 1.1 to 3.5, and everywhere the following is used in the markup:
Design_Time_Lock: true
e.g.
<asp:linkbutton id="lbRun" style="Z-INDEX: 111; Design_Time_Lock: True" runat="server">Run</asp:linkbutton>
[Code]....
I've read up about the Design_Time_Lock attribute, and I can see when it will and won't be generated. However I don't really understand the point of it. And- more importantly- can all instances of it be safely removed throughout the code?
View 1 Replies
Feb 8, 2012
Alright, I have a vb6 LEGACY application and new Functionality (Form) written in c#. I have a VB.NET COM Class as a wrapper. I can launch the .NET Form just fine. THe problem I am having is closing the .net form from vb6.
Example:
In VB6, I have something like this:
CODE:
But it does not work becuase frmViewer is Nothing for some reason. how I should close the .NET form that was launched from VB6?
View 8 Replies
Feb 19, 2009
What is Environment.FailFast? How is it useful?
View 4 Replies
Jan 9, 2009
We have a couple of applications at work that need a reference to the license server set in the User Variables under the Enviroment Variables on the windows xp client machines(system properties, Advanced, Enviroment Variables). The problem is that both applications needs a reference to the same variable name and you can't have two with the same name. What i intend to do is to create a simple windows application with a button for each application that deletes the variable item present, adds a new variable item with the value needed for that application to be able to run and then run the application itself. This is just a temporary fix until we get a more permanent solution. The 'GetEnvironmentVariable' class in vb is not able to add or delete a item, maybe the WIN32 API could do the job.
View 2 Replies
Feb 17, 2012
I was trying to learn how to do openGL within a VB .NET environment and it seems that the Tao framework or OpenTK is recommended with OpenTK having a higher recommendation so that is what I chose to try using. Since I am brand new to this, I am trying to just draw a simple box, triangle, or anything really so that I can understand it all before making more complex things. I have been unsuccessful at this so far so I will list in order what I have done so far and hopefully someone here can help me correct it or provide a new example just so I can draw a simple shape.
1) I installed OpenTK using opentk-2010-10-06.exe
2) In a new project I added the references to OpenTK.dll and OpenTK.Compatibility.dll
3) I added the control (opentk.glcontrol.dll)
4) I added the actual control to my form.Using some examples online I added the rest:
5) I wrote my references in:
Imports OpenTK
Imports OpenTK.GLControl
Imports OpenTK.Platform
[code]....
The above results in no display?
View 2 Replies
Jul 15, 2009
i could make a 3d environment in VB.net which i could in the future make into a game environment or could i only do this with a language such as C++?
View 2 Replies