You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When calling this method, the *pdwMaxLength* parameter should initially contain the maximum length of the string buffer referenced by the *lpszUrl* parameter. The value of the *pdwMaxLength* parameter will be updated with the actual length of the URL string.
Copy file name to clipboardExpand all lines: docs/build/calling-dll-functions-from-visual-basic-applications.md
+55-57
Original file line number
Diff line number
Diff line change
@@ -12,60 +12,58 @@ ms.author: "corob"
12
12
ms.workload: ["cplusplus"]
13
13
---
14
14
# Calling DLL Functions from Visual Basic Applications
15
-
For Visual Basic applications (or applications in other languages such as Pascal or Fortran) to call functions in a C/C++ DLL, the functions must be exported using the correct calling convention without any name decoration done by the compiler.
16
-
17
-
`__stdcall` creates the correct calling convention for the function (the called function cleans up the stack and parameters are passed from right to left) but decorates the function name differently. So, when **__declspec(dllexport)** is used on an exported function in a DLL, the decorated name is exported.
18
-
19
-
The `__stdcall` name decoration prefixes the symbol name with an underscore (_) and appends the symbol with an at sign (@) character followed by the number of bytes in the argument list (the required stack space). As a result, the function when declared as:
20
-
21
-
```
22
-
int __stdcall func (int a, double b)
23
-
```
24
-
25
-
is decorated as:
26
-
27
-
```
28
-
_func@12
29
-
```
30
-
31
-
The C calling convention (`__cdecl`) decorates the name as `_func`.
32
-
33
-
To get the decorated name, use [/MAP](../build/reference/map-generate-mapfile.md). Use of **__declspec(dllexport)** does the following:
34
-
35
-
- If the function is exported with the C calling convention (**_cdecl**), it strips the leading underscore (_) when the name is exported.
36
-
37
-
- If the function being exported does not use the C calling convention (for example, `__stdcall`), it exports the decorated name.
38
-
39
-
Because there is no way to override where the stack cleanup occurs, you must use `__stdcall`. To undecorate names with `__stdcall`, you must specify them by using aliases in the EXPORTS section of the .def file. This is shown as follows for the following function declaration:
40
-
41
-
```
42
-
int __stdcall MyFunc (int a, double b);
43
-
void __stdcall InitCode (void);
44
-
```
45
-
46
-
In the .DEF file:
47
-
48
-
```
49
-
EXPORTS
50
-
MYFUNC=_MyFunc@12
51
-
INITCODE=_InitCode@0
52
-
```
53
-
54
-
For DLLs to be called by programs written in Visual Basic, the alias technique shown in this topic is needed in the .def file. If the alias is done in the Visual Basic program, use of aliasing in the .def file is not necessary. It can be done in the Visual Basic program by adding an alias clause to the [Declare](/dotnet/visual-basic/language-reference/statements/declare-statement) statement.
55
-
56
-
## What do you want to know more about?
57
-
58
-
-[Exporting from a DLL](../build/exporting-from-a-dll.md)
59
-
60
-
-[Exporting from a DLL using .DEF files](../build/exporting-from-a-dll-using-def-files.md)
61
-
62
-
-[Exporting from a DLL using __declspec(dllexport)](../build/exporting-from-a-dll-using-declspec-dllexport.md)
63
-
64
-
-[Exporting C++ functions for use in C-language executables](../build/exporting-cpp-functions-for-use-in-c-language-executables.md)
65
-
66
-
-[Determining which exporting method to use](../build/determining-which-exporting-method-to-use.md)
[DLLs in Visual C++](../build/dlls-in-visual-cpp.md)
15
+
16
+
For Visual Basic applications (or applications in other languages such as Pascal or Fortran) to call functions in a C/C++ DLL, the functions must be exported using the correct calling convention without any name decoration done by the compiler
17
+
18
+
`__stdcall` creates the correct calling convention for the function (the called function cleans up the stack and parameters are passed from right to left) but decorates the function name differently. So, when **__declspec(dllexport)** is used on an exported function in a DLL, the decorated name is exported.
19
+
20
+
The `__stdcall` name decoration prefixes the symbol name with an underscore (_) and appends the symbol with an at sign (**\@**) character followed by the number of bytes in the argument list (the required stack space). As a result, the function when declared as:
21
+
22
+
```C
23
+
int __stdcall func (int a, double b)
24
+
```
25
+
26
+
is decorated as `_func@12` in the output.
27
+
28
+
The C calling convention (`__cdecl`) decorates the name as `_func`.
29
+
30
+
To get the decorated name, use [/MAP](../build/reference/map-generate-mapfile.md). Use of **__declspec(dllexport)** does the following:
31
+
32
+
- If the function is exported with the C calling convention (**_cdecl**), it strips the leading underscore (_) when the name is exported.
33
+
34
+
- If the function being exported does not use the C calling convention (for example, `__stdcall`), it exports the decorated name.
35
+
36
+
Because there is no way to override where the stack cleanup occurs, you must use `__stdcall`. To undecorate names with `__stdcall`, you must specify them by using aliases in the EXPORTS section of the .def file. This is shown as follows for the following function declaration:
37
+
38
+
```C
39
+
int __stdcall MyFunc (int a, double b);
40
+
void __stdcall InitCode (void);
41
+
```
42
+
43
+
In the .DEF file:
44
+
45
+
```
46
+
EXPORTS
47
+
MYFUNC=_MyFunc@12
48
+
INITCODE=_InitCode@0
49
+
```
50
+
51
+
For DLLs to be called by programs written in Visual Basic, the alias technique shown in this topic is needed in the .def file. If the alias is done in the Visual Basic program, use of aliasing in the .def file is not necessary. It can be done in the Visual Basic program by adding an alias clause to the [Declare](/dotnet/visual-basic/language-reference/statements/declare-statement) statement.
52
+
53
+
## What do you want to know more about?
54
+
55
+
-[Exporting from a DLL](../build/exporting-from-a-dll.md)
56
+
57
+
-[Exporting from a DLL using .DEF files](../build/exporting-from-a-dll-using-def-files.md)
58
+
59
+
-[Exporting from a DLL using __declspec(dllexport)](../build/exporting-from-a-dll-using-declspec-dllexport.md)
60
+
61
+
-[Exporting C++ functions for use in C-language executables](../build/exporting-cpp-functions-for-use-in-c-language-executables.md)
62
+
63
+
-[Determining which exporting method to use](../build/determining-which-exporting-method-to-use.md)
Copy file name to clipboardExpand all lines: docs/build/command-modifiers.md
+12-10
Original file line number
Diff line number
Diff line change
@@ -12,13 +12,15 @@ ms.author: "corob"
12
12
ms.workload: ["cplusplus"]
13
13
---
14
14
# Command Modifiers
15
-
You can specify one or more command modifiers preceding a command, optionally separated by spaces or tabs. As with commands, modifiers must be indented.
16
-
17
-
|Modifier|Purpose|
18
-
|--------------|-------------|
19
-
|@*command*|Prevents display of the command. Display by commands is not suppressed. By default, NMAKE echoes all executed commands. Use /S to suppress display for the entire makefile; use **.SILENT** to suppress display for part of the makefile.|
20
-
|**-**\[*number*]*command*|Turns off error checking for *command*. By default, NMAKE halts when a command returns a nonzero exit code. If -*number* is used, NMAKE stops if the exit code exceeds *number*. Spaces or tabs cannot appear between the dash and *number.* At least one space or tab must appear between `number` and *command*. Use /I to turn off error checking for the entire makefile; use **.IGNORE** to turn off error checking for part of the makefile.|
21
-
|**!***command*|Executes *command* for each dependent file if *command* uses <strong>$\*\*</strong> (all dependent files in the dependency) or **$?** (all dependent files in the dependency with a later timestamp than the target).|
22
-
23
-
## See Also
24
-
[Commands in a Makefile](../build/commands-in-a-makefile.md)
15
+
16
+
You can specify one or more command modifiers preceding a command, optionally separated by spaces or tabs. As with commands, modifiers must be indented.
17
+
18
+
|Modifier|Purpose|
19
+
|--------------|-------------|
20
+
|\@*command*|Prevents display of the command. Display by commands is not suppressed. By default, NMAKE echoes all executed commands. Use /S to suppress display for the entire makefile; use **.SILENT** to suppress display for part of the makefile.|
21
+
|**-**\[*number*]*command*|Turns off error checking for *command*. By default, NMAKE halts when a command returns a nonzero exit code. If -*number* is used, NMAKE stops if the exit code exceeds *number*. Spaces or tabs cannot appear between the dash and *number.* At least one space or tab must appear between `number` and *command*. Use /I to turn off error checking for the entire makefile; use **.IGNORE** to turn off error checking for part of the makefile.|
22
+
|**!***command*|Executes *command* for each dependent file if *command* uses <strong>$\*\*</strong> (all dependent files in the dependency) or **$?** (all dependent files in the dependency with a later timestamp than the target).|
23
+
24
+
## See Also
25
+
26
+
[Commands in a Makefile](../build/commands-in-a-makefile.md)
Copy file name to clipboardExpand all lines: docs/build/commands-in-a-makefile.md
+24-21
Original file line number
Diff line number
Diff line change
@@ -12,24 +12,27 @@ ms.author: "corob"
12
12
ms.workload: ["cplusplus"]
13
13
---
14
14
# Commands in a Makefile
15
-
A description block or inference rule specifies a block of commands to run if the dependency is out-of-date. NMAKE displays each command before running it, unless /S, **.SILENT**, **!CMDSWITCHES**, or @ is used. NMAKE looks for a matching inference rule if a description block is not followed by a commands block.
16
-
17
-
A commands block contains one or more commands, each on its own line. No blank line can appear between the dependency or rule and the commands block. However, a line containing only spaces or tabs can appear; this line is interpreted as a null command, and no error occurs. Blank lines are permitted between command lines.
18
-
19
-
A command line begins with one or more spaces or tabs. A backslash ( \ ) followed by a newline character is interpreted as a space in the command; use a backslash at the end of a line to continue a command onto the next line. NMAKE interprets the backslash literally if any other character, including a space or tab, follows the backslash.
20
-
21
-
A command preceded by a semicolon (;) can appear on a dependency line or inference rule, whether or not a commands block follows:
[Inline files in a makefile](../build/inline-files-in-a-makefile.md)
33
-
34
-
## See Also
35
-
[NMAKE Reference](../build/nmake-reference.md)
15
+
16
+
A description block or inference rule specifies a block of commands to run if the dependency is out-of-date. NMAKE displays each command before running it, unless /S, **.SILENT**, **!CMDSWITCHES**, or \@ is used. NMAKE looks for a matching inference rule if a description block is not followed by a commands block.
17
+
18
+
A commands block contains one or more commands, each on its own line. No blank line can appear between the dependency or rule and the commands block. However, a line containing only spaces or tabs can appear; this line is interpreted as a null command, and no error occurs. Blank lines are permitted between command lines.
19
+
20
+
A command line begins with one or more spaces or tabs. A backslash ( \ ) followed by a newline character is interpreted as a space in the command; use a backslash at the end of a line to continue a command onto the next line. NMAKE interprets the backslash literally if any other character, including a space or tab, follows the backslash.
21
+
22
+
A command preceded by a semicolon (;) can appear on a dependency line or inference rule, whether or not a commands block follows:
Copy file name to clipboardExpand all lines: docs/build/filename-macros.md
+24-22
Original file line number
Diff line number
Diff line change
@@ -12,25 +12,27 @@ ms.author: "corob"
12
12
ms.workload: ["cplusplus"]
13
13
---
14
14
# Filename Macros
15
-
Filename macros are predefined as filenames specified in the dependency (not full filename specifications on disk). These macros do not need to be enclosed in parentheses when invoked; specify only a $ as shown.
16
-
17
-
|Macro|Meaning|
18
-
|-----------|-------------|
19
-
|**$@**|Current target's full name (path, base name, extension), as currently specified.|
20
-
|**$$@**|Current target's full name (path, base name, extension), as currently specified. Valid only as a dependent in a dependency.|
21
-
|**$***|Current target's path and base name minus file extension.|
22
-
|**$****|All dependents of the current target.|
23
-
|**$?**|All dependents with a later timestamp than the current target.|
24
-
|**$<**|Dependent file with a later timestamp than the current target. Valid only in commands in inference rules.|
25
-
26
-
To specify part of a predefined filename macro, append a macro modifier and enclose the modified macro in parentheses.
Filename macros are predefined as filenames specified in the dependency (not full filename specifications on disk). These macros do not need to be enclosed in parentheses when invoked; specify only a $ as shown.
17
+
18
+
|Macro|Meaning|
19
+
|-----------|-------------|
20
+
|**$\@**|Current target's full name (path, base name, extension), as currently specified.|
21
+
|**$$\@**|Current target's full name (path, base name, extension), as currently specified. Valid only as a dependent in a dependency.|
22
+
|**$***|Current target's path and base name minus file extension.|
23
+
|**$****|All dependents of the current target.|
24
+
|**$?**|All dependents with a later timestamp than the current target.|
25
+
|**$<**|Dependent file with a later timestamp than the current target. Valid only in commands in inference rules.|
26
+
27
+
To specify part of a predefined filename macro, append a macro modifier and enclose the modified macro in parentheses.
0 commit comments