o
k
q
u
e
s
t
i
o
n
s
.
c
o
m

Custom Functions... -

Hey all,
So, I've got this function that is supposed to just set pass a StdFont variable, after setting it's arguments from data in some arrays.
VB Code:
  1. Private Function getGeneralFontData(intSectionIndex As Integer, intSizePosition As Integer) as StdFont
  2.  
  3. Dim sFnt As New StdFont
  4. sFnt.Size = garrChequePrinterCfg(intSectionIndex, intSizePosition) * 2
  5. sFnt.Name = garrChequePrinterCfg(intSectionIndex, intSizePosition + 1)
  6. If garrChequePrinterCfg(intSectionIndex, intSizePosition + 2) = "Yes" Then
  7.     sFnt.Bold = True
  8. Else
  9.     sFnt.Bold = False
  10. End If
  11. getGeneralFontData = sFnt
However, when I attempt to execute this funtion, I get the following error:
Run-time error '91':
Object variable or With block not set
(this is making a reference to the line getGeneralFontData = sFnt)

I thought that I set getGeneralFontData when I declared the function? When I remover the "as StdFont" part, the function actually seems to work, except for some reason the first time the function executes the values are passed incorrectly.
Thoughts?

 

Custom Functions -
I have an Access database with custom functions i created and they are used in query's. When I execute the ADO query from VB, I get a 'Fuction not defined' error. How can I use these functions in the database?


Custom Functions Question -
Hi again, When entering values for parameters in certain functions/procedures in VB, you are presented with a menu with all of the available options. Is it possible to do this in custom functions? For example, if I had a function called 'query', with the parameter 'mode' ( query


[2005] Executing an Access query that uses custom functions -
Hello, I am trying to run a MS Access query from VB.NET. The query that I want to run uses a custom function that I built into a module in the database. When I try to execute that SQL statement from VB.NET it gives me an exception saying that the custom function is not defined. Righ


[2008] Custom Controls -> Removing unwanted properties/functions/subs -
I am going to start creating for myself a large amount of 'Custom' controls, however, often when inheriting the 'control' type in classes, you end up with a lot of unwanted properties / subs / functions, that are default with it... Is there anyway to make a control, without inheriti


how to create commandbar and custom functions -
how do i create a commandbar and some custom function like =report(A1:A2) and is able to be install so that i can port it to other pc?? i have check out web site from here and it seems like COM add-in through the VS.NET won't be able to cater for the custom function is it true?? s


Default Value for a Field in Access -
I am trying to get the functionality of a sequence in Access 2000/XP. i already have an auto number field in my table so that is not an option either. i need to set my default value of a field to a custom function/query such that i can get the value stored in a another table as my defa


Need suggestions for custom classes -
I am nearing completion of my second major database endeavor in VB.NET. I know (in theory, anyway) all about the advantages of object-oriented programming. However, the code I have written up to now works fine just using subroutines, functions, and the standard .NET classes and contr


Aim Q -
I have seen plenty of Modules for AIM functions on PSC and stuff but i was wondering if anyone knows how to make a custom autoresponder. This would be used for a custom away message per sn (say my sis IMed me i could say "shut up you dumb *****" or somethin)


Drawing Canvas and VB's Circle\Line\Pset methods... -
Hello, I have a project to make a drawing program and I am supposed to use the Circle\Line\PSet methods of a picturebox\form... well, seeing as when you move a form offscreen, or if you alt-tab\minimize the program, the whole thing gets cleared (redrawn), what i want to do is use Creat


custom usercontrol which has another custom usercontrol inside -
Hi friends, I have strange problem on my custom control. I made a custom usercontrol which has another custom usercontrol inside, i am using this control on a form and it is working very well. But when i transfer this form with its custom controls to another project, it is giv


Outlook 2003 - Adding simple functions to userform -
Hello! So I'm working on a custom userform in Outlook 2003 that's supposed to be used for users who send e-mail to custom relations (support). The idea is that they should get a form that they can fill in information such as name, username, software etc etc. There's nothing but


type and member functions -
In VB, how can I make a custom type have member functions like C++ classes can?


Dynamic Libraries - please help! -
Hi! I've been wondering for a long while about this. In many applications I've seen all custom DLLs are in the program directory and one often can't access them from VB ActiveX insert, etc. How do the developers do this? I thought that you always need to register a DLL/OCX before yo


Crystal Report Constants -
I'd like to use a set of constants across all my crystal reports... is there some kind of central repository i can use to define them, and then i can use them in all my reports... ? I;ve added 'Custom Functions' for this purpose at the moment... but i would htink there would be so


copy function from api to custom DLL -
hi, Is it possible to 'copy' functions from, let's say, kernel32.dll to a custom DLL? and is it usefull? When i have a small app that uses one function from a large DLL very often. is it better for the speed of the app. to extract the function and put it in a new DLL? so it w


Help making a DLL -
I have VB4 apps that use custom dll's. I want to make a VB6 dll that will do the same job. I have the functions and subs that call the dll which are 16bit. Can a dll be made only knowing the functions/subs? I know I will have to convert Integer to Long, thats normal for 16bit dll


copy api-functions to yor own dll -
hi, Is it possible to 'copy' functions from, let's say, kernel32.dll to a custom DLL? and is it usefull? When i have a small app that uses one function from a large DLL very often. is it better for the speed of the app. to extract the function and put it in a new DLL? so it won'


Loading pictures as Custom resource -
Thanks Megatron, How do I load a .JPG from resource file as custom resource? The following doesn't work... imgBackImg.Picture = LoadResPicture(1, CUSTOM) Should I replace 'CUSTOM' with something else? Thanks.


change font without... -
I have this custom control that is a text box, but i dont know how to put in it the following function thingys: .SelFontName .SelFontSize .SelBold .SelItalic .SelUnderline .SelStrikeThru .SelColor If you noticed, the Rich text box has the functions above, so what is the cod


[2005] Custom Button / Button Attributes -
Hey. I'm curious if it's possible some one could point me in the direction of some pre-written custom button(s) (particularly with more attribute fields for info), or let me know step by step how to add some custom attributes for the default button? I've read a few items on adding


[2005] Protecting dll files -
I have two dll files that I use with all my programs. One has my custom controls in it and the other has my common functions in it. I am looking to release the dll files so others may use the functions in similar programs, but I do not want to release the source just yet. My problem


Default Functions -
Is there any way that i can edit vb in such a way that it allows me to be able to add my functions say Public Sub GetCenter() etc to the standard list of functions that vb has ? Do i need to make a dll that loads each time vb does that has these functions in ?


[2005] Custom Buttons -
Hi, I'm currently building my own custom mp3 player. What I'd like to do is make some custom buttons for play, stop, fast forward, and so on.. Anyone know of a good place where I can find custom buttons like these? Or maybe even how to make my own? Any help is appreciated. Than


Loop through controls "textbox(x).text =" -
Hi guys, I have 5 custom controls on my page. custom1 custom2 custom3 custom4 custom5 All i want to do is this: x = 1 custom(x).text = "hello" But i cannot work it out without big functions and checking every control on the page. Please help!!!


Accessing custom fields in custom outlook form -
in outlook vba code behin form we use the following syntax to access custom filed in a custom form Item.GetInspector.ModifiedFormPages.("PageName").Controls. "ControlName").Property Can u tell me how to access custom fields through Visual Basic give me sa


ASP Custom COM Components -
Hi, I have developed a COM component for my web site, completely finished the many thousands of lines of code, all to find that the only sites that will allow custom COM components will cost me loads. so obviously i want to take what i have in my COM component and put it in another


save a custom toolbar with a custom button as an add-in -
Hi, I have problem when I try to save a custom toolbar with a custom button as an add-in (.xla) so they can be loaded everytime I start excel. Any idea? Furthermore, I can't do it in powerpoint as well. maira.


[2008] Create Custom Logonui.exe -
I have created a custom logonui.exe in VB.NET and I know how to make it replace the existing logonui.exe, but I am having trouble with the functions, such as shutdown, restart and log in. I don't need to get the list of users, because there is only one user account on the system and it


friend functions in vb -
Friend functions are functions defined outside a class (ie, not member functions), but which the class declares to be friends so that they can use the class's private members. this is i guess the basic definition of a friend function but i have seen codes where friend keyword is use


custom user control -
I am new at trying to make custom controls. Basically, say we have a list of items to "do". Each item will be displayed on a custom control. Within this. for each item, I want it to be represented by labels and a progress bar against each item. Thats fine I guess,


Custom Controls - Tutorial -
Anyone know a good source where I can find some examples and explanations of how to create and use custom controls. I need to display addresses and instead of having to create a bunch of different controls for each address I'd like to just make one custom control and then add as m


custom action not running -
I created a custom action (.exe) for my application's windows installer to run at the end of the installation. I added the .exe to the File System/Application Folder, added .exe to the Custom Actions/Install & Commit. But after the installation, I noticed that the custom action was


[2005] Using custom control regadless of it's signature -
Hi I have created a custom control in vb.net. I am using this control in one of my application. Now the problem is that, the application doesn't loads the custom control whenever custom control is compiled because of new changes. Big red cross is displayed on the form. This is beacu


Can I create custom buttons using Word VBA -
Hi, I am writing an application in Word which will require a few custom buttons. The user will click on these to perform certain tasks. I have already created a custom toolbar, but creating the custom buttons is proving a little tricky. Any help would be greatly appreciated


cahnge mosu pointer -
hi, I want the form to have a custom cursor. I selected custom from the mousepointer part and chose a custom cursor file, but there is only a black shape. No colors. What can I do?


Functions File -
I have a bunch of functions that all my forms use How do I make each form have these functions I want it to be in one location so i can rewrite those functions at any time then compile it again, instead of editing each form


Functions -
Can someone explain to me how to make a custom function. Like a function that takes and returns something.


[2005] Help with polymorphism of UserControl -
I'm trying to figure out how to implement Polymorphism on some custom UserControls that I have created, but can't quite get it. Say I have UserControl1 and UserControl2. They have different functionality, but some common public functions and properties. On the form where they ar


SQL Jet functions -
Does anyone know what functions (especially string functions) the Jet engine can cope with? Ive tried Mid, right, left, instr and loads of others but cant find any that work. The error is always that Jet doesnt recognise the function. Ive tried looking round on the web for a list


Where should I look to learn Custom API Programming -
Hi, I am learning VB.net and I have a vague, yet important question. Where should I look to learn how to program simple applications in custom API's ? You know, like all the fancy shmancy custom windows and stuff. Thanks in advance, -RuSty