What is "Private Declare Function ....."?

Private Declare Function Function_Name Lib "user32" () As DatatypeI've found such lines used in many VB6 projects and tutorials.What is it? What actually is this used for? Are there more such function? How to find out more such function/properties?A detail explanation will be helpful and h ...

Declare function with calling convention

I would like to declare function with calling convention.But getting following errors on CentOS 4.7 with GCC 3.4.6test.c:3: error: syntax error before "display"test.c:3: warning: data definition has no type or storage classtest.c:12: error: conflicting types for 'display'test.c:3: error: p ...

the most effective way to declare function used in several classes?

What's the most effective way (in terms of quantity of code written and good design of course) to declare function(s) that is used in the ctors (and only there!) of several different classes?What I can think of is:1. Each class has its own method, but methods have identical bodies - poor design, not ...

Public Declare function

Below is the public declare function I have add to a module in my projectPublic Declare Sub PortOut Lib "io.dll" (ByVal Port As Integer, ByVal Value As Byte)Public Declare Function PortIn Lib "io.dll" (ByVal Port As Integer) As ByteHowever, when I compile the project, the error o ...

Re: Declare Function...SetBkMode

In one newsgroup I asked that how can I print text with a transparentbakcground to printer. The answer was that I have to use the SetBkModeAPI function because there's a bug in VB printer object.I tried to put this lineDeclare Function SetBkMode Lib "gdi32" (byval hdc as Long, byvaliBkMode ...

Oracle Cannot use "declare function" in XMLQuery statement

I'm using Oracle 11g. In a SQL*Plus terminal, if I enter, say: select XMLQUERY('1'passing (XMLTYPE('<dummy />')) returning content) from dual; I get, as expected, "1" as an answer. Now, if instead I enter the following code: select XMLQUERY('declare function local:one($arg) {1};local:one(.)'pa ...

Declare function

i'm very new to VC++ and i need help with something ....i've been to some site on VC++ and some of the answer to some question was given in this form:void CMyBrowser::OnViewSource() {}the problem is how do u add this function into your project ?i want to make use of the sample code given but the pro ...

How to declare function?

Long time ago, in a galaxy far, far away there was language named "Borland Pascal".In this language you were able to declare class and it's methods and then declare some functions inside your class' methods. They didn't belong to class, and you could only call them from method you've decla ...

Declare statement for VC++ Dll Function with ::

Declare statement for VC++ Dll Function :: with Scope Resolution Operator OMG.... I am over my head!! I have managed to get comfortable using DLL in VB using a Declare statement and in my latest attempt I have run into a function using the "::". Scope Resolution Operator. Is it possible to ...

how to declare a function in VBA?

I have an excel application.I have a dll which I want to declare a function from it.Private Declare Function SetIniFile Lib "eXtraRF.dll" (ByVal sIniFile As String) As BooleanThe dll is in the same directory of the xls file - But when running the .xls file from the excel it thinks that the ...

How to declare and use a VC++ dll function from VB6

I am really stuck and sick of looking at VC++ pointers! A dll function that makes use of a Void** pointer (pointer to a pointer?). Below is the VC++ function and my attempt to declare it. I am lost thereafter as how to use the dll.The dll provides serial communication with a camera through an indust ...

VBScript and API

HiHow can i declare an api function in vbscript?this is in VB:Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd ...

vbscript limitations

I want to execute a mailto in a sub in vbscript,but it looks like you can't use declare statements to reference DLLs, in vbscript.I want to be able to effectively execute this code below, so the script can send a simple email.How can I get around these limitations in VBscript?Public Const URL = ...

Expose VC++ .Net function to VB .Net

I maintain a Visual C++ Version 6 app. It takes data structures from an Excel app, processes results, and returns structures to Excel. I must now write a C++ .Net wrapper, to take datasets from a VB.Net calling app, create structures from the datasets, send the structures to the Visual C++ Version 6 ...

Calcuation Function

I have a simple form that has three checkboxes, each with a separate value, and the same onclick event handler. This event handler takes care of accumulating the totals from each check box that has been checked. I then need to be able to take this sum and multiply it against a sales tax and output a ...

How to use .dll file and its function in .asp page

I have a small query regarding .dll fileWe are using RTA600 time and attendence machine to record the employee time table... We are using TSMCOM32.dll file to interface that machine with our aplication which has developed in visual basic.... Its working fine and well..Now i wanna make interface onli ...

where should function template be defined?

In C/C++, function template is defined before the main() function;In Visual C++, if function template is defined in head file, it can work well;but if I declare function template in head file, and define it in implement file, it can't work. Where function template is defined in Visual C++? ...

API function

Declare Function abGetSystemDirectory Lib "kernel32" _Alias "GetSystemDirectoryA" (ByVal lpBuffer As String, _ByVal nSize As Long) As LongPrivate Sub Command8_Click()Dim strBuffer As StringDim intLength As IntegerDim strDirectory As StringstrBuffer = Space$(160)intLength = abGetS ...

call dll function from within VC++ dll

all, I have made a VC++ (5) dll and I'd like it to call some functions from an existing dll (belonging to MapInfo software). I know how to access the funtions using MapBasic (similar to VB), but I need to be able to do the same thing from my VC++ dll. Can anyone tell me what the code would look like ...

Function PID2 in the Windows XP and Access 2003

Why this function don´t work correct with the Windows XP and Microsoft Access 2003?In the line "PID2" exist a err.Public Declare Function GetCurrentProcessId Lib "kernel32" () As LongPublic Declare Function GetCurrentProcess Lib "kernel32" () As LongPublic Declare Func ...

static function - optimization?

If i declare function as static, does compiler do any optimization?say for exsay i have a function ,void myFunc()if I declare it as static void myFunc(), what is the Adv over If i keep as void myFunc()? ...

Need help with float function and sales tax code!

there! I have written a program with fixed costs for a vacation. I need to add sales tax in for the total amount but this needs to be floating. Also, I had intended this to be a user input based program, but without knowing the float code for calculation, I dont know how to proceed.Any pointers or h ...

Trouble calling VB function from C DLL

I've been able to design a front-end for a C DLL, calling the DLL functions from the VB program but I'm having trouble calling the VB functions from the C DLL. Maybe I should have put this in the C forum, but I don't know.If I have this in a VB module:Public Declare Function callback Lib "C:\c\ ...

Oracle Function defined in anonymous block?

Quick question. I'd like to define a temporary function in a PL/SQL anonymous block. I'm thinking that I've seen an example of that done before, but I can't seem to find the example. Here's the source. Given a table name, I want to return a comma-delimited list of the columns in the table. As a stor ...

Calling DLL Function

I want to test the functions which are residing in DLL made in VB.Is any body know, how to do.I try by declaring DLL asDeclare Function CheckLogin Lib "Login" (username As Variant, password As Variant)But after running the script it gives the error not found checklogin function in Login dll.If any o ...

ShellAndWait function

I have an Access app that allows a user to click a button to FTP a file from the network out to one of our Unix servers. What I need is a way to make sure the FTP process was successful. I was able to find this ShellAnd Wait function but it doesn't seem to be working. I've tested it by intentionally ...

how to pass the datapool row count to a called function,when the count increments

I am trying to pass the row of a datapool in to a called function? can someone explain ,how it can be done?how can i pass the datapool row count inside the called function. whenever the for loop increments?gaya3 '$Include "sqautil.sbh"'$Include "projheader1.sbh"Declare Function SCL_exfunction(x as i ...

Compile error: only comments may appear after End Sub, End Function, or End Property

I'm using Access 2007, and i don't know if the problem is related to that.I'm trying to get the username logged on to the network using the following code:Public Declare Function Lib "advapi32" Alias "GetUserNameA" (ByVal lpBuffer as String, nSize as Long) as LongFunction GetUser ...

GetProcAddress and function pointers

Im trying to inject my vb.net dll into the notepad process to hook one of its functions. Now it seems i face two problems....GetProcAddress returns 0 (it also does if i call that function via c++ dll)Its might be Vista? anyway next problem is that i want to write the address of the new function into ...

Step Into Function

I have a script that calls a function utilizing the following method:--> Call ValidateProcess (sTest)I have a header included:--> '$Include "F:\Automation\RobotAutomationProjects\TestAssets\Scripts\Master.sbh"Here is my data from the header file:--> Declare Function ValidateProcess BasicLib ...

VB.NET 'As Any' is not supported in 'Declare' statements

This is m y code::Private Declare Function WritePrivateProfileString Lib "kernel32" Alias "WritePrivateProfileStringA" (ByVal lpApplicationName As String, ByVal lpKeyName As Any, ByVal lpString As Any, ByVal lpFileName As String) As LongPrivate Declare Function GetPrivateProfileS ...

Error calling a VC++ DLL function from VB

Hi. This has something to do with VB, but maybe someone did a similar thing.I need to call a function from a DLL created in VC++:Private Declare Function OpenPrinter Lib "CDI.dll" (PrinterName As String) As LongIn my code:Dim HandleHandle = OpenPrinter(Printer.DeviceName)But I get error 49 ...

Trouble with struct arrays and getdata function

Quote ... I have an assignment that requires me to use an array, menuList, of struct menuItemType with members string menuItem and double menuPrice. I have to display the menu, let the customer order, total the bill including tax and print the check. Function getData had to load the data into the ar ...

Function question

Here is the code:#include <cstdlib>#include <iostream>using namespace std;//Declare functionint triangle(int num);int main() {int n;cout<<"Enter a number and press RETURN: ";cin>> n;cout<<"Function returned:"<<triangle(n)<<endl;return 0;} ...

how to pass two variables to a function call C++

I am trying to edit this program to pass two variables to the function call using a passing-by-reference. I need help as to how to modify what I have. Any help would be appreciated.#include "stdafx.h"#include <iostream>using std::cout;using std::endl;int incr10(int& num); // Decl ...

Get variables parsed to a function

Does anyone know how to get all the variables parsed to a function without declaring them in the function call?Basically, i want to add parameters to function that you dont have to use. Rather than do something like:// Call FunctionMyFunction('','','');I'd prefer to do:// Call FunctionMyFunction();/ ...

Calling Dll function from VB

I have created a simple DLL with Win32 Application Extension Wizard. I have a a couple of function that are to called from a VB project. Thus I have set the calling convension to __stdcall in the Project Settings. In VB I have used the following syntax:Private Declare Function fTest Lib "<Pa ...

Calling DLL function in VB

the problem is :Calling VC DLL function in VBA. How can I change a string in DLL function(writed by C++) and return it back to VBA by paramete.this is VBA declearDeclare Function CreateBoxd Lib "macroshell" (Params As Double, Tags As Long, ByRef error_msg As String) As Longand this is VC d ...

Casting Problem with FindMimeFromData Function

I'm getting a casting error using the code below. The error on the web page (when you click the error icon) is:Sys.WebForms.PageRequestManagerServerErrorExceptio n: Conversion from string "application.msword" to type "Long" is not valid.It's to do with declaring the mimeout integ ...

How to access a VB DLL function (that has an Alias) in VC Client

I have a non-COM VB DLL that has the following two functions exposed Declare Function EtCompress& Lib "COMPPL32.DLL" (ByVal SrcSeg%, ByVal SrcOfs%, ByVal SrcLen&, ByVal DestSeg%, ByVal DestOfs%, ByVal DestLen&, ByVal CompSpeed%)Declare Function EtCompress32& Lib "COMPP ...

How to use VC and realize the function in VB

I compiled a matlab file into DLL, according to the help from mathwork.com, I also call it from VB, but I want it to work with my VC program. So does anyone have the experience in calling DLL generated by matlab compiler from VC?Or, we may put this question in another way:how can I use VC and realiz ...

An OLE in-process DLL DllGetClassObject function

I'm writing an OLE in-process DLL. There is a need to export DllGetClassObject function.I can do it by using .DEF, but how can I do it by using __declspec(dllexport) statement. If I declare function asSTDAPI __declspec(dllexport) DllGetClassObject(params...)there a warning about old style.If I decla ...

How use a DLL function exported via ordinal value

Visual Basic can use functions inside a DLL that do not have an alias or function name. The following is an example:Declare Function SHRestartSystemMB Lib "shell32" Alias "#59" _(ByVal hOwner As Long, _ByVal sExtraPrompt As String, _ByVal uFlags As Long) As LongHow can this be do ...

Default function parameter

I have some question with default function parameter, The question is when I declare function pnd set parameter likevoid Func(int a, int b=1){}void main(){//If I call Func(10);//The callFunc(10,11)}In this case, what is function signature of "Func"? ...

Help with adding sales tax and float function

there! I have put together a Spring break calculator and I am unsure how to add the sales tax to the cost and declare the float function for costs. Any help would be great! Just need help being pointed in the right direction! Thanks!!!#include <iostream>#include <iomanip>#include <str ...

Oracle Problem with user defined function in XQUERY

I have a file in which I store XQUERY. My java program reads this file and executes the xqueryand output the result. I have a working XQUERY in a file, which is something like :<feed>{let $entries := for $x in collection('/path/to/atomStore.bdbxml')/entry[matches(id,'.entry')]order by $x/updat ...

Issues with converting code into a function

I am trying to get the code that i got working in This Post (http://www.codeguru.com/forum/showthread.php?t=444825) into a module / function so that i can re-use it later but im getting some issues.I call the function using: Dim Reg_List As BooleanReg_List = List_Registry_String_Names(HKEY_CURRENT_U ...

Using a DLL in VB6, how to declare?

Hello, I have this C Code:typedef int (WINAPI *dll_type)(u_char *STR, int len, void *datas);dll_type dll_function_pointer;//This is the structure name data.struct {u_int num1;u_char *str1;u_int num2;u_int num3;u_int num4;u_int str1len;u_int num5;u_int num6;} data;hLib = LoadLibrary("NAME.DLL ...

About DLL EXPORT FUNCTION, please help!

Recently, I found an article which tells us how to make a standard DLL using VB6.0 ( for more info : http://www.windowsdevcenter.com/pub/a/windows/2005/04/26/create_dll.html ) my code goes here:'************************' In a ActiveX DLL project'************************Public Declare Function CallNe ...

calling function for command button

hi, i'm a newbie on programming.i am using smart card reader and have the sdk(gsdkpcsc.dll) for programming.then, i already wite down all the declaratiion for the module.i also have made the command button.my project is, i) when click at the READ button, it will start communication with smart card i ...