Conversion Types For DLL Implementation?

Aug 23, 2010

I need to use some functions from a DLL written in C++. Problem is when I try to use those functions in VB (Visual Studio). The only way I get to pass the debugger without errors is if I use the VariantType type, but I get all screwed up values. Can anyone tell me how can I "translate" the use of char [6] into VB from C++? My problem when Implementing is with the variable INFO, the content comes back after execution with errors..This is the original code from the DLL Manual:

Code:
Int Get_Info(A Handle, char *IPAddr, InfoType *Info)
where the parameters:
A [IN] Handle.
IPAddr [IN] IP address

[code]....

View 4 Replies


ADVERTISEMENT

Arrays And Generic Types - Conversion

May 10, 2011

Well this is maybe a little different than other array based conversion questions, but I'm dealing with forced typing concerns due to interface implementation and thus would like a few opinions on the process. I've basically redesigned the Collection suite for .Net because I don't like the extreme simplicity of the default Collections and dictionaries, as well, when I want the more complex concepts I don't want to have rewrite the same collection over an over again.

[Code]...

View 2 Replies

VS 2008 Singleton Factory Implementation - Is Pattern Implementation Right

Mar 18, 2010

So I've been doing some research on the singleton factory design pattern, and I am wondering if my example implementation is correct (warning I did get carried away creating animals):

[Code]...

View 6 Replies

C# - Get A Technical Reason For No Implicit Conversion From DBNull To Nullable Types?

Jan 10, 2012

Is there a technical reason why there is no implicit conversion from DBNull to the various nullable and/or sql types? I understand why the conversions don't currently happen, but don't understand why an implicit conversion wasn't created at the time or added in subsequent versions of the framework.Just to be clear, I'm looking for technical reasons, not "because that's they way they did it" or "I like it that way".

View 2 Replies

C# :: Determining Object Equivalence For Value Types, Reference Types And ILists?

Nov 1, 2009

I have a class with a Property called 'Value' which is of type Object.Value can be of any type, a structure, a class, an array, IList etc.My problem is with the setter and determining whether the value has changed or not.This is simple enough for value types, but reference types and lists present a problem.For a class, would you assume that the Equals method has been implemented correctly, or just assume that the value has changed every time the setter is called?If I did assume it's changed, then perhaps I should assume it for value types as well, so that the behaviour is consistent.

View 2 Replies

Compare Two Types In Dictionary Of Types .net?

Jun 23, 2012

I need to compare two dictionary values if the types stored are equal, this is what i have

if gettype(Args(key)) = gettype(argtypes(key)) then
'' do something
end if

[Code]....

View 1 Replies

Conversion Error On Line 5 Stating 'Conversion From String 'S' To Type 'Double' Is Not Valid

Apr 8, 2009

a user will enter a number, n, which ranges from 1 to 30. they will also enter a "P" or an "S" (sum or product). depending on which was selected, it will calculate the sum or product of the numbers from 1 to n.i'm having a conversion error on line 5 stating "Conversion from string "S" to type 'Double' is not valid." [code]

View 2 Replies

Text -> Excel Conversion (with Extensive Formatting Required After Conversion)?

May 11, 2012

I'm creating a program in VB.net that does the following:At a high level I receive a file in email, put the attachment in a monitored folder, import the text file to excel, format the excel, and then email the excel file to a list of recipients.

Here is my plan:

Completed: Outlook VBA to monitor all incoming email for specific message. Once message is received drop attached .txt file in a specific network folder.

Completed: (VB.net) Monitor folder, when text file is added begin processing

Not Complete: (VB.net) Import text file to Excel

Not Complete: (VB.net) Format Excel Text file.(add in a row of data,format column headers with color/size, add some blank columns, add data validation to some of the blank columns that allow drop down selections)

Completed: (VB.net) Save file.

Completed: (VB.net) Send file to list of recipients.

Obviously the items above that are not complete are the bulk of the work, but I wanted to get some advice on what some of you think would be the best way to approach something like this. The import and formatting of the file are causing me some problems because I just can't decide what would be the most efficient way to do this.

The way stated above. Import to excel -> format Having a template excel that contains all of the formatting already done for me and attempting to transition the data to this document (no clue if/how I can do this). Is it even feasible? Have the template already created and then import the text file to a new excel file, then transition that data to the excel template?

Something I thought about, in terms of formatting the document, was to record a macro of me doing all of the formatting that I'm going to need and then attempt to convert that macro into my vb.net code, but I'm not sure if that will work. I will need to verify that the text file comes in the EXACT format every time correct?

View 5 Replies

Bad Implementation Of IDisposable?

Oct 20, 2009

I am a budding MCTS so I am not a 100% sure of whether I am correct in this instance.I am looking through a windows forms application created by a developer who has left our company some time ago. Within the code I have found a custom form derived from the standard form baseclass which explicity implements IDisposable.The custom form does not call any COM object or do any file IO operations and has only one database call which is closed and disposed off in the method that calls it. However within the code of the form there is the following,[code].....

Looking at this am I right in thinking that this should be removed including the implements IDisposable line at the top of the form since,

1. The listeners collection will go out of scope when the form does as the collection only references listener objects (which do not implement IDisposable).

2. The controls do not explicitly need disposing, since when the form goes out of scope this will be done anyway.

View 4 Replies

Implementation Of C++ Code In .net ?

Aug 20, 2009

I have developed a C++ program code .Now, I want to access this code in VB.net .

View 2 Replies

.net - IBindableComponent Interface Implementation ?

Jan 19, 2011

I need to implement the IBindableComponent to the the following code:

Public Class InfragisticsToolStripBindableButton
Inherits Infragistics.Win.UltraWinToolbars.ButtonTool
Implements IBindableComponent

[CODE]...

1 problem: Warning: event 'Disposed' conflicts with property 'Disposed' in the base class 'DisposableObject' and should be declared 'Shadows'

2 problem: Error: Class 'InfragisticsToolStripBindableButton' must implement 'Property Site As ISite' for interface 'System.ComponentModel.IComponent'. Implementing property must have matching 'ReadOnly' or 'WriteOnly' specifiers.

Why should I implement "IComponent" if I implement "IBindableComponent"?

3 problem: How should I override "Dispose", if it's already implemented in the base class, but is not virtual apparently.

View 1 Replies

.net - Performance Of Implementation Of IComparer?

Jul 14, 2011

I'm sorting a collection of type "Document" (usually around 100k records). Sorting usually takes around 4-5 seconds, and I'm wondering if there's a way to speed up sorting by modifying my "DocumentComparer" class which implements IComparer(Of Document). Since the Compare() method would be called hundreds of thousands of times, are there any performance improvements that could be made here that I've overlooked?

[Code]...

View 2 Replies

.net - Some IBindableComponent Interface Implementation?

Feb 8, 2011

I need to implement the IBindableComponent to the the following code:

Public Class InfragisticsToolStripBindableButton
Inherits Infragistics.Win.UltraWinToolbars.ButtonTool
Implements IBindableComponent

[code].....

View 2 Replies

2d - .NET Liang-Barsky Implementation?

Nov 6, 2010

After some research, I've decided to use the Liang-Barsky line clipping algorithm in my 2D game. Google did not deliver on any VB.NET implementations of this algorithm but plenty C/++ ones. Therefore, as I have knowledge in C++, decided to port one found on Skytopia over to VB.Net. Unfortunately, it does not work with:

Public Class PhysicsObject
Public Function CollideRay(ByVal p0 As Point, ByVal p1 As Point, ByRef clip0 As Point, ByRef clip1 As Point) As Boolean
Dim t0 As Double = 0.0
Dim t1 As Double = 1.0

[code]....

However, the CollideRay method fails on its 3rd edge iteration (edge = 3), r < t0, therefore the function returns false.

View 1 Replies

Asp.net - Error On An Icomparer Implementation

Nov 12, 2010

I created an array sorter to sort arrays like in Win Explorer in a DNN module. As in the answer to a preview question: Sorting an array of folder names like Windows Explorer (Numerically and Alphabetically) - VB.NET

[Code]....

View 1 Replies

C# - Free Implementation Of Printf?

Mar 1, 2010

The problems:

I can't use string.Format, I have C style format strings;I can't call the native printf (no P/Invoke);I can't use http://www.codeproject.com/KB/printing/PrintfImplementationinCS.aspx because of the license, I need something GPL-compatible.Is there a free implementation of printf/sprintf for the .net framework? Other than the above link, I couldn't find anything.

I cooked up a sprintf function that supports basic format strings, you can find it here: [URL].. I'll try to make it a complete implementation if I can.

View 3 Replies

Convert C# Event Implementation To VB?

Apr 11, 2012

I am trying to use some C# code that expands on the GridView functionality in a VB.NET project. The code I'm using is from here.

In the C# code there is an event definition for GroupHeader [code]...

View 2 Replies

Implementation Of IDisposable Into Classes

Mar 8, 2009

I implemented IDisposable into one of my classes, but don't know if I did it correctly. Can someone tell me what will be cleared from memory and what will remain after calling .Dispose on an instance of this class? [Code]

View 5 Replies

Interface Implementation Deference?

May 21, 2010

What is the diference of using interfaces like ...I have an interface

Public Interface IProDataSource
Function read() As Integer
End Interface[co]....de

The only difference I have notice is that if the method is declare private it will be visible using the first approach only.

View 3 Replies

Is LinkedList Implementation Of .Net Threadsafe

Apr 26, 2011

I am working on an application which uses multiple threads to work on number of tasks and the parent application receives the output of the task,later to be written to files, currently I am using arraylist to append output to, but that happens to be slow when removing items from queue.I was thinking to convert arraylist part to linkedlist for optimized reads and clears,if linkedList Implementation of .Net is threadsafe or even using arraylist was threadsafe?

View 3 Replies

Our App Uses: ASP.Net, .Net, And Microsoft's AJAX Implementation?

Mar 3, 2011

The middleware that manages talk between the mainframe and our app is blowing up randomly. It's a "such and such attempted to read/write protected memory..." error.The vendor is saying there we must be running some unmanaged code (I feel they're trying to worm out of it). I know VB's entirely managed, but does anyone know about the server portion of AJAX? Is there any server side javascript stuff that occurs before it actually gets into the .NET framework?

View 1 Replies

Program To An Interface Instead Of Implementation?

Dec 25, 2009

I have been reading about design patterns and application architecture and im told that I should program to an interface instead of implementation. This i understand. So I figured I would start with something small. Never programmed with an interface before. So I want to create an encryption program that will allow the user to select which method to encrypt it with, AES, DPAPI, etc. I started designing the Interface but I am unsure if I am doing this right. [Code] Also, when it comes to the DPAPI implementation, how is the client supposed to supply the Protection Scope? I didn't think this should be in the interface as it only applys to the DPAPI.

View 1 Replies

Java Conversion To .net Conversion Errors

Aug 31, 2009

Here's 2 questions that I hope someone can help me on. This is in VB.net. I keep on getting this error 'java.io.bufferedInputstream.count is not accessible in this context because it is 'Protected Friend'. Does anyone know how to fix this error?

The other errors i get are "Overload resolution failed because no accessible 'Val' accepts this number of arguments". I have listed below the code that I have coverted from Java. Where is my mistake?'the underlined areas are where it is giving me errors.

[Code]...i

View 7 Replies

.net - Optimize This Simple But Horrible Implementation?

Jul 27, 2011

I basically want to remove the formula from the cells but want to retain the calculated values.

SO, I implemented it easily and it works great but REALLY SLOW. (About 2 mins for 1800 cells)

I have : Dim col As Excel.Range = getRange()For Each cell In col cell.Value = cell.Value Next

I tried to do this to the first cell and then autofill the rest, but that copied the value of 1st cell to the rest of the cells in column.

View 7 Replies

Best Practice Example Of An MVP Implementation Of Unit Testing

May 4, 2009

Can anyone point me towards a complete scenario using MSTest,vb.net, with or without mocks,MVP (supervising controller)

View 1 Replies

C# - Custom SNMP Trap Implementation In .Net?

Oct 2, 2009

I need to create a monitoring mechanism using SNMP (in .Net). I think we'll be using an nsoftware component to handle most of the work. It appears we must use 'traps' to communicate from the agent to the server. We'll have a number of different traps and various information detailing each trap. What is the best way to implement custom traps? That is, what is the best way to not only send a trap, but also send the information describing the trap to our 'snmp manager'? I think this is done through "variable bindings". To use "variable bindings" do we need to create our own "enterprise number" and use an "enterpriseSpecific" trap? Should we implement our own, custom MIBs or can we just send the data we need with the trap (via variable bindings)?

View 2 Replies

C# - User-initiated Action Implementation?

Aug 17, 2010

In Flash 10 there are methods that require that they are triggered from user-initiated actions like button click, keyboard up/down keys, etc.Is it possible to implement this behaviour in .NET? For example, if we have this subroutine:

void SomeMethod() {
// Here some stuff
}

how to check inside it whether the method was called from a mouse click event handler?Also we can think of this methods like the protected functions in World of Warcraft.

EDIT: Looks like this behaviour is implemented in Silverlight — we can popup file dialogs (open, save) ONLY by mouse click or other user-initiated action, otherwise a SecurityException will be thrown. I want to achieve this bevaviour but in my case it's not a file dialog but our own methods.

View 2 Replies

Change The Implementation Functino Of IDisposable?

Dec 30, 2009

just wondering if we could change the implementation functino of IDisposable.Dispose to a private. because the default i've got something like this:

[Code]...

Protected Overridable Sub Dispose(ByVal disposing As Boolean) or could i take away the the Protected Overridable and replace it with a Private access modifier?

View 9 Replies

Convert Interface Implementation From Program To C#?

Sep 11, 2010

This may seem like an obvious answer, but I can't seem to find an answer. I have this code in VB.NET[code]...

The problem with this is that in C#, it would seem you have to name the function the same as the interface function you are implementing. How can I call this method EncryptionVB instead of Encryption, but still implement the Encryption property?

View 5 Replies

Explicit Interface Implementation In Program?

Oct 16, 2009

How to implement explicit interface implementation in VB.NET?

View 3 Replies







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