473,399 Members | 3,888 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,399 software developers and data experts.

Building DLL's

I have a function, originally written for use in Access97, which formats a
character string, according to the format prescribed in the code that calls
it. What this means is that if you run a string containing a Scottish
surname (such as McDonald) through the function, it will come out with the
correct letters converted to Uppercase. Also, it'll correctly format a UK
postal code, or UK telephone number, as dictated by the switch in the code.

Now, in Microsoft Access, the following code would be used:

For a character field to be formatted as a standard text string, the code
would read "sMyText = TextFormat(sMyText,"Text") "
For a character field to be formatted as a UK Postal Code, the code would
read "sMyText = TextFormat(sMyText,"Pcode")
For a character field to be formatted as a UK Phone Number, the code would
read "sMyText = TextFormat(sMyText,"Phone")

Now, I've successfully converted the TextFormat functions so that they
compile properly using VB.NET. However, I've got no way of testing that it
does exactly what it's supposed to do. I need to know the following:

1. How do I register the DLL so that it can be picked up by any
application that happens to need it
OR
Can I write code that will register the DLL before it runs it,
without causing a conflict if the DLL has already been registered.
2. How do I create a form, in a separate project, that can be used to
check whether the function is working properly?

I'd be really grateful if anyone can help me with this - it's been doing my
head in for about a week now.

Thanks in Advance
Ian Henderson
Database Developer and .NET Novice

Nov 20 '05 #1
9 3144
Private Sub Button1_Click_1(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click

Dim str As String = "hello"

str = StrConv(str, vbProperCase)

MessageBox.Show(str)

End Sub

"Steven Smith" <St**********@emailaccount.com> wrote in message
news:64****************************@phx.gbl...
This seems similar to what I'm trying to achieve 3 posts
above... :s

Nov 20 '05 #2
That works for the StrConv function. However, the StrConv function doesn't
handle Scottish surnames.

For example, if you pass "mcdonald" into StrConv, it will return it as
"Mcdonald". The function that I written will take the same input string (ie
"Mcdonald"), and pass it back as "McDonald". Also, it'll handle
double-barrelled surnames, such as Rhys-Jones, which StrConv would pass back
as "Rhys-jones".

Any ideas?

TIA
Ian Henderson
"One Handed Man [ OHM ]" <te***************************@BTOpenworld.com>
wrote in message news:eB**************@TK2MSFTNGP10.phx.gbl...
Private Sub Button1_Click_1(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click

Dim str As String = "hello"

str = StrConv(str, vbProperCase)

MessageBox.Show(str)

End Sub

"Steven Smith" <St**********@emailaccount.com> wrote in message
news:64****************************@phx.gbl...
This seems similar to what I'm trying to achieve 3 posts
above... :s


Nov 20 '05 #3
Cor
Ian,
I think that maybe the regex.replace will help you.

I would solve your problem just with an array, but I think the regex.replace
is better.

I never used it because I find making patterns always difficult.

But today someone send a link of his a tool to make those patterns
http://www.radsoftware.com.au/web/Products/

I hope this helps a little bit.
Cor
Nov 20 '05 #4
mid(TargetString, start, count) = UCase(ReplacementSTring)
???
Nov 20 '05 #5
I tried that the other day. That approach has always worked for me in the
past, using VBA in Access97. However, if you try it in vb.NET, you get a
message telling you that it doesn't like it. The only way of doing it is as
previously described, by replacing the incoming string.

Thanks anyway.

Ian
"Steven Smith" <St**********@emailaccount.com> wrote in message
news:0a****************************@phx.gbl...
mid(TargetString, start, count) = UCase(ReplacementSTring)
???

Nov 20 '05 #6
Hello,

"Steven Smith" <St**********@emailaccount.com> schrieb:
mid(TargetString, start, count) = UCase(ReplacementSTring)
???


I think the problem is writing the algorithm that does the replacement for a
whole name.

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
http://www.mvps.org/dotnet
Nov 20 '05 #7
Why dont you create a class for this conversion instead ?, if you really
want to create a DLL you will need to use C++ ( not sure if you can do this
in C# )


"Ian Henderson" <ih********@essentiagroup.com> wrote in message
news:bj*******************@news.demon.co.uk...
I tried that the other day. That approach has always worked for me in the
past, using VBA in Access97. However, if you try it in vb.NET, you get a
message telling you that it doesn't like it. The only way of doing it is as previously described, by replacing the incoming string.

Thanks anyway.

Ian
"Steven Smith" <St**********@emailaccount.com> wrote in message
news:0a****************************@phx.gbl...
mid(TargetString, start, count) = UCase(ReplacementSTring)
???


Nov 20 '05 #8
If that's the case, why does VB.NET give me the option to build components
and compile them as DLLs? Certainly the online help I've looked at talks
about using RegSrv32, but contains references to C++ code.

Ian
"One Handed Man [ OHM ]" <te***************************@BTOpenworld.com>
wrote in message news:e4**************@TK2MSFTNGP12.phx.gbl...
Why dont you create a class for this conversion instead ?, if you really
want to create a DLL you will need to use C++ ( not sure if you can do this in C# )


"Ian Henderson" <ih********@essentiagroup.com> wrote in message
news:bj*******************@news.demon.co.uk...
I tried that the other day. That approach has always worked for me in the past, using VBA in Access97. However, if you try it in vb.NET, you get a message telling you that it doesn't like it. The only way of doing it
is as
previously described, by replacing the incoming string.

Thanks anyway.

Ian
"Steven Smith" <St**********@emailaccount.com> wrote in message
news:0a****************************@phx.gbl...
mid(TargetString, start, count) = UCase(ReplacementSTring)
???



Nov 20 '05 #9

I'm not sure exactly where you are looking at Ian, but to the best of my
knowledge you cannot compile DLL's from Visual Basic.NET in the way you are
trying to. However, if you do generate a DLL from VC++, and want to call a
user function ( as you do ) from VB.NET then this is of course possible.

But, why go to all this bother when you can port your logic ( and I cant
think that its too complex ) to a VB class definition.

Probably not what you wanted to hear but . . .

Regards OHM
"Ian Henderson" <ho**@ihenderson.co.uk> wrote in message
news:bj**********@sparta.btinternet.com...
If that's the case, why does VB.NET give me the option to build components
and compile them as DLLs? Certainly the online help I've looked at talks
about using RegSrv32, but contains references to C++ code.

Ian
"One Handed Man [ OHM ]" <te***************************@BTOpenworld.com>
wrote in message news:e4**************@TK2MSFTNGP12.phx.gbl...
Why dont you create a class for this conversion instead ?, if you really
want to create a DLL you will need to use C++ ( not sure if you can do this
in C# )


"Ian Henderson" <ih********@essentiagroup.com> wrote in message
news:bj*******************@news.demon.co.uk...
I tried that the other day. That approach has always worked for me in the past, using VBA in Access97. However, if you try it in vb.NET, you
get a message telling you that it doesn't like it. The only way of doing it

is
as
previously described, by replacing the incoming string.

Thanks anyway.

Ian
"Steven Smith" <St**********@emailaccount.com> wrote in message
news:0a****************************@phx.gbl...
> mid(TargetString, start, count) = UCase(ReplacementSTring)
> ???



Nov 20 '05 #10

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

Similar topics

2
by: AIM | last post by:
Error in msvc in building inheritance.obj to build hello.pyd Hello, I am trying to build the boost 1.31.0 sample extension hello.cpp. I can not compile the file inheritance.cpp because the two...
1
by: Player | last post by:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello all I am using VS.NET 2003. What I am doing apart from teaching myself C# is learning my way round V.NET2003 also.
0
by: Vani | last post by:
Has anyone come across this issue? There seems to be a behavioral difference (and possible bug) in visual strudio 2003 when building a vc.net solution through IDE and building the same solution...
2
by: tony | last post by:
Hello!! I use VS 2003 and C# for all class library except MeltPracCommon.dll which is C++.NET The problem is that I get these warnings when building the exe file and use my class libraries....
1
by: Diffident | last post by:
Hello All, I have a question as to why my users are noticing error when I am building the project on the production system. Here is the problem's background. In order to build the project on...
3
by: tony | last post by:
Hello!! I use VS 2003 and C# for all class library except MeltPracCommon.dll which is C++.NET The problem is that I get these warnings when building the exe file and use my class libraries....
0
by: michaeldavidcox | last post by:
I have one project that is giving me an error but only when I build it outside of VS 2005 IDE: C:\Code\GUI\Form1.vb(731) : error BC31094: Implementing class 'DSO.ServerClass' for interface...
0
by: Herman Jones | last post by:
I'm getting the following error when I build a Class Library project: Embedding manifest... Project : error PRJ0002 : Error result 1 returned from 'C:\WINDOWS\system32\cmd.exe'. It happens with...
2
by: wpw | last post by:
Hi I have problem in building my application wich contains 54 dlls and one of which is always fails in building in both modes, this particular dll is around 69K and only workaround sofar is to...
13
by: treble54 | last post by:
I need to build PHP from source with the pdo_ibm extension and I am having an issue with it. Firstly, I am using Visual Studio .NET 2003 and I am building PHP from source through the Visual Studio...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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...

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.