15,891,473 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by Marino_Y0301 (Top 14 by date)
Marino_Y0301
13-Dec-22 3:40am
View
Sorry for the late reply. Thanks for the detailed explanation.
For DB reasons, the source extension cannot be changed from ".sc" to ".cpp".
Unfortunately the method you taught didn't work for me.
Marino_Y0301
30-Nov-22 3:35am
View
Thank you for your kindness.
I checked two projects, but I can't understand how to setting keys.
How can I count the buffer size (count of structs)?
In the project you gave me, it seemed to display the received value by using "CString". For example, is it possible to modify this example to get the value with "wcsncpy_s" instead of "CString" and use "strncpy_s" to store the value in another struct containing a Char?
That's what I want to do...
Marino_Y0301
30-Nov-22 1:21am
View
I still need to question the code.
As it turns out, the screen switched even with 6.
But your answer gave me a clue. When I specified 0 (vbHide) the screen didn't switch anymore!
Thanks, I was able to solve the problem.
Marino_Y0301
28-Nov-22 23:52pm
View
It worked fine in Windows 7, so the need to change the status was a blind spot.
I'll change it to 6.
Thanks for sharing your solution.
Marino_Y0301
28-Nov-22 23:47pm
View
I'm new to app design, so I hadn't thought of that. Thanks for letting me know.
But I shouldn't change the use of MsgBox this time.
I will refer to this when I create a new app. Thanks for coming up with the solution.
Marino_Y0301
28-Nov-22 23:28pm
View
Thank you for your comment.
I forgot to mention the environment.
I am using excel 2019 on windows10.
So I can't test your answer, sorry.
Marino_Y0301
28-Nov-22 3:13am
View
I'm sorry. and thank you for pointing that out.
Marino_Y0301
28-Nov-22 3:10am
View
Deleted
hello. Details of the error are below.
"Attempted a read or write operation to protected memory. Other memory may be corrupted."
I always get this error message when there is a problem with a DLL I created with VC++.
Marino_Y0301
16-Nov-22 3:46am
View
I'm appreciate to your kindness.
I see your example, and I learned how to use GUID.
Thanks for the example, it was very easy to understand. I will use it as a reference.
I am very grateful.
Marino_Y0301
15-Nov-22 2:50am
View
Thank you for the other day!
Your hint helped me.
I solved it with the program source that will be posted later. However, I'm wondering if it's better to specify a GUID. (Either way, the purpose of the processing can be achieved. It is the place commented (//~) in the structure definition of the program source.)
We also want to avoid unnecessary definitions, as there are several other functions that need similar modifications. Please lend me your wisdom.
Marino_Y0301
15-Nov-22 2:41am
View
Thank you for your help a few days ago!
As a result of various considerations, marshalling the structure on the VB side and treating it as an LPARRAY instead of a SAFEARRAY on the VC++ side worked well.
I will post the answer later.
Your advice helped me.
I'm really thankful to you!
Marino_Y0301
14-Nov-22 5:52am
View
Thanks for any help.
Perhaps I'm not making enough effort, but I haven't been able to find an effective solution for linking VC++ and VB.NET using "LPSAFEARRAY"...
VC++ seems to work fine except for "SafeArrayPutElement(psa, &idx[0], &npos);". (If you try to display "psa" in a message box after "SafeArrayPutElement(psa, &idx[0], &npos);", nothing will be displayed, so it seems to be empty...)
Is it difficult to display with MessageBox ( NULL, psa, TEXT ("TEST psa"), MB_OK)? (Sorry for the beginner's question)
Marino_Y0301
14-Nov-22 5:40am
View
Hi,
I tried marshalling, but no luck.
<What I tried>
ByRef → ByVal
:Calling VC++ gives no error, but the struct passed from VB does not contain any data.
<out(), marshalas(unmanagedtype.safearray,="" safearraysubtype:="VarEnum.VT_ARRAY)" byval="" byref~="">
:There is no error when calling VC++, but an error occurs when referencing the struct passed from VB in subsequent processing.
<out(), marshalas(unmanagedtype.safearray)="" byval="" byref~="">
:In the case of "ByVal", an error occurred when calling VC++. In the case of "ByRef", an error occurred when referring to the structure in subsequent processing after calling VC++.
<out() byval="" byref~="">
:In the case of "ByVal", calling VC++ gives no error...but the struct passed from VB does not contain any data.In the case of "ByRef", an error occurred when referring to the structure in subsequent processing after calling VC++.
Is there something wrong with my marshalling? So far, passing structs "ByVal" seems to work better.
Marino_Y0301
11-Nov-22 3:02am
View
Thank you!
But sorry, I made a mistake in writing the following program.
Correctly:
**①API_Refer.vb**
'' Function
Public Declare Function Esql_SelNonPosDetail Lib "Esql_Dll.dll" _
(ByVal SrvNum As String, ByRef RecordCnt As Long, ByRef dtpPS_Det() As tpPS_Det2) As Integer
Unfortunately, even after changing ByRef to Byval, there was no data in dtpPS_Det (structure tpPS_Det2).
It should have been edited from VC++, but I don't know why...
Do I need "MarshalAs" when calling from VB? Since the VC++ side treats it as "LPSAFEARRAY", should I pass it as a pointer?
If you have any idea, please help me.
Show More