Home > Software engineering >  Windows 7 in vb6 function can't use vbwide strconv?
Windows 7 in vb6 function can't use vbwide strconv?

Time:10-05

In his Windows 7 vb6 complete enterprise edition,
StrConv function with vbwide parameters, operation times wrong in VB6 environment "invalid procedure call or parameters,"
Use vbNarrow parameters is the same,
Use vbUnicode parameters such as there is no problem,

The same program I in Win XP environment under the code into an EXE file, in this installed in the Windows 7 computer run is very normal,

I don't know the problem there,

CodePudding user response:

StrConv function


Returns a specified type conversion Variant (String),

Syntax

StrConv (string, conversion, LCID)

StrConv function grammar have been named the following parameters:

Part of the description
String parameters, necessary to convert the string expression,
Conversion necessary parameters, Integer, its value and the type of conversion,
LocaleID LCID optional, if the system is different, it is LocaleID (system LocaleID for default values,)


Set the value

Conversion parameter setting value is:

Constant value description
VbUpperCase 1 text string to uppercase,
VbLowerCase 2 will string literal to lowercase,
VbProperCase 3 every word at the beginning of the letters in the string to uppercase,
VbWide * 4 * single-byte characters in a string into a double byte character,
VbNarrow * 8 * double-byte characters in a string into a single-byte characters,
VbKatakana * * 16 * * hiragana characters in the string into a katakana characters,

VbHiragana 32 * * * * katakana characters in the string into hiragana characters,
VbUnicode 64 according to the system default code page will into Unicode string,
VbFromUnicode 128 string from Unicode to system default code page,



* is applied to the far east country,

* * only applied to Japan,

Note these constants are designated by VBA, can use them to replace the real value in the process, most of them can be combined, such as vbUpperCase + vbWide, mutex constant can't combination, vbUnicode + vbFromUnicode, for example, when the country is not applicable to use constant vbWide, vbNarrow, vbKatakana, and vbHiragana, will result in a runtime error,

Here are some general valid delimiter: Null (CRH $(0)), horizontal TAB (CRH $(9)), line (CRH $(10)), vertical tabs (CRH $(11)), in page (CRH $(12)), enter $(13) (CRH), blank (SBCS) (CRH $(32)), in a DBCS, blank actual value varies according to the countries/regions,

Description

Byte array into a string in the ANSI format, you should use StrConv function, when you convert Unicode format of the array, use the assignment statement,


If you can't use, please pay attention to your Windows language environment configuration

CodePudding user response:

reference 1st floor Veron_04 response:
...
When the use of constant vbWide shall not apply to the country, vbNarrow, vbKatakana, and vbHiragana, will result in a runtime error,
.
If you can't use, please pay attention to your Windows language environment configuration


I also suspect is for this reason,
But, here I use Windows 7 (32) simplified Chinese, control panel in the "regional and language" is a "Chinese (simplified Chinese)", these should be no problem,

CodePudding user response:

Don't to give others consider compatible mode vb6

CodePudding user response:

With Windows 7 under the code into exe running?
And WinXP under the code into exe in the same directory,
Right, see compatibility Settings are consistent,

CodePudding user response:

In a 64 - bit Windows:
64 exe and DLL in the directory c: \ Windows \ sys tem32 directory.
32 bit exe and DLL in the directory c: \ Windows \ sys wow64 directory.
So pay attention to:
In win64 system registered under 32-bit ocx DLL to 32 ocx or copy the DLL to the c: \ Windows \ syswow64 \ directory,
And registered to c: \ Windows \ syswow64 \ regsvr32 XXXXXXX ocx or DLL
  • Related