-
Notifications
You must be signed in to change notification settings - Fork 134
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Troubles in using the MapWinGIS activeX in C++ program. #190
Comments
Hello @haquocviet I'm guessing you might be the same person who commented in the MapWinGIS Discourse group? Either way, I will add comments there. I have done an MFC dialog-based application in the past, and it worked well. I don't know anything about WTL, so I can't speak to that. But I will try to document the process I went through to create the app. Regards, |
Hi @jerryfaust Thank you for the reply. Yes I was the one posted on that group. I asked again here just because I thought that forum may be less active than here. From your confirmation, I have tried to use the MapWinGIS in an MFC app and I could see the ActiveX is loaded successfully. However, I am still fail to make WTL/ATL works. Regarding the WTL, it is just a very light layer based on ATL to help developers to develop Windows GUI without using MFC, in addition, WTL is more favor to COM than MFC. (Forgive me not to answer you on the Discourse group, if I do, it should be duplicated). |
Hello @haquocviet I'm sorry, but at the moment I have no meaningful feedback for you. I would probably have to create a WTL application it in order to step through myself, and try to see what is happening with the OCX. If you are able, you could build a debug version of the OCX so that you could step through and catch any errors inside the OCX. I think more likely, though, it is an issue in how the ATL/WTL framework is handling the OCX rather than the OCX itself, but I can't tell from the exception. Is your current build 64-bit? I've not used VS2019, but it looks like the addresses shown are perhaps 64-bit addresses. But you said that you tried a 32-bit application with the 32-bit OCX, is that right? I don't know about VS2019, but prior to VS2019, you cannot debug a 64-bit OCX inside Visual Studio. You have to code/debug in 32-bit, then you can compile in 64-bit for the final executable. Until this is figured out, I would encourage you to work strictly with the 32-bit OCX within a 32-bit application. Kind Regards, P.S. We have been encouraging people to move toward the Discourse website for questions and discussion, rather than using GitHub. Perhaps GitHub would be used strictly for bugs and code submissions. |
Hi @jerryfaust Here are more things I realized after trying some ways.
// MFC: ctlinplc.cpp. I have it after adding MFC package to current MSVC 2019.
Looking at the stack's memory, the "pWndOuter" has NULL window handle, therefore
I attach the WTL sample here. If you have WTL installed, you can try the sample. |
It's been years since I've done anything with WTL but I found this article. https://www.codeproject.com/Articles/4174/WTL-for-MFC-Programmers-Part-VI-Hosting-ActiveX-Co |
Thanks @dhuantes. |
MapWinGIS-5.1.1-win32/x64-VS2017.
My Dev tool: VS2019 16.5 + WTL.
Though I the activeX works well in a C# program, I could not make it working in a C++ program.
The program always crashes when it tries to load the activeX at the function below.
I want someone to confirm that if the activeX supports integration with ATL/WTL C++ programs.
The text was updated successfully, but these errors were encountered: