NetTalk Central

Author Topic: How to create a Multi DLL with WebServer  (Read 6256 times)

de la Rosa

  • Full Member
  • ***
  • Posts: 128
    • View Profile
    • Email
How to create a Multi DLL with WebServer
« on: July 16, 2020, 10:37:07 PM »
Hi,

I tried example 20 and it worked fine with the Main/Chat example. I even renamed the Chat window to ChatWindow to differ with the chat.app name and it was fine. But when I tried to add a WebServer Window in the Chat.app, the chat app still compiled fine, but the main.exe results in Unresolved External WEBSERVER@F in Main001.obj - That's even when the WebServer is found defined in the EXP file.

Thanks for any help.

Vic

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: How to create a Multi DLL with WebServer
« Reply #1 on: July 17, 2020, 05:09:31 AM »
I've tried to parse that sentence a few times - but I admit I'm completely lost <g>.

I guess this is the main part;

>> I tried example 20 and it worked fine with the Main/Chat example

After that I've no idea what you are actually trying to accomplish...

>> But when I tried to add a WebServer Window in the Chat.app,

Why are you doing this?

cheers
Bruce

de la Rosa

  • Full Member
  • ***
  • Posts: 128
    • View Profile
    • Email
Re: How to create a Multi DLL with WebServer
« Reply #2 on: July 17, 2020, 05:26:34 PM »
Sorry to confuse you Bruce but here's what I'm trying to do.

I'm trying to learn how to convert a single exe NetTalk Web app into multi dll in preparation for separating the report part into a dll for easier updating and maintenance.

So I started with the multi DLL example 20 and compiled and worked fine.

Since the chat.app and the chat window are both named chat, for learning purposes it was confusing so I renamed the chat Window to ChatWindow and it worked fine too.

Now, since the chat.app has the Nettalk extension in it. I added the WebServer Globals extension to it. Then imported a bare bones Webserver and compiled it, it compiled fine.
Then I  added a button to call the Webserver from the Main app but when I compiled it, it resulted in "Unresolved External WebServer@f ... ".

Next, I removed the imported webserver and added a simple Window on the Chat.app  and named it WebServer. It was successfully compiled and called from the Main app.

So my problem is how can I properly instantiate a webserver procedure on the chat.app so that I can call it anywhere else. In addition, How do I build my Nettalk Report Webapp on a separate dll when it seems it can't be seen elsewhere? 


Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: How to create a Multi DLL with WebServer
« Reply #3 on: July 19, 2020, 10:17:23 PM »
Hi Vic,

I think you might be on completely the wrong track.

but if you get an Unresolved External message, then make sure

a) the procedure has EXPORT turned on where you are exporting it from
b) the procedure has the same prototype in the app where it lives, and the app where you are calling it from.
c) the app with the procedure, where you are EXPORTing it from, is a DLL

cheers
Bruce

de la Rosa

  • Full Member
  • ***
  • Posts: 128
    • View Profile
    • Email
Re: How to create a Multi DLL with WebServer
« Reply #4 on: July 21, 2020, 12:34:22 AM »
Hi Bruce,

Ok, it's the prototype declaration of the WebServer procedure in the Main app that was causing the Unresolved External Error.

However, my real problem was caused by using the Multi DLL ABC example instead of the WebServer Multi DLL example.

Thanks,
Vic


de la Rosa

  • Full Member
  • ***
  • Posts: 128
    • View Profile
    • Email
Re: How to create a Multi DLL with WebServer
« Reply #5 on: July 22, 2020, 04:44:18 AM »
Hi Bruce,

How come Example 20 does not define a prototype for the WebServer in the MainExe.app but still works? While on mine it results with an Unresolved External WebServer@f?

However, when I define the WebServer prototype, it compiles fine but ends up with an exemption error when launched.

Vic

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: How to create a Multi DLL with WebServer
« Reply #6 on: July 22, 2020, 10:12:10 PM »
>> How come Example 20 does not define a prototype for the WebServer in the MainExe.app but still works?

The prototype, as declared in MainExe.App is the same as the prototype as declared in WebServer.App.

Cheers
Bruce

de la Rosa

  • Full Member
  • ***
  • Posts: 128
    • View Profile
    • Email
Re: How to create a Multi DLL with WebServer
« Reply #7 on: July 23, 2020, 03:07:56 AM »
Hi Bruce,

Attached is the WebServer procedure in the MainExe app without any prototype defined. Or did I missed defining it somewhere else?

Thanks,
Vic

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: How to create a Multi DLL with WebServer
« Reply #8 on: July 23, 2020, 06:15:06 AM »
I think best if you ask in the User Group webinar - we're obviously not understanding each other here...

Jane

  • Sr. Member
  • ****
  • Posts: 372
  • Expert on nothing with opinions on everything.
    • View Profile
    • Email
Re: How to create a Multi DLL with WebServer
« Reply #9 on: July 23, 2020, 09:12:29 AM »
Just another WAG....

I think that if the webserver procedure is in the EXE, you do not need to define its prototype.

If it's in a DLL, you do.   (<NetWebServer pServer>),name('WebServer')

As shown on page 9 of this PDF:  https://www.capesoft.com/docs/nettalk11/Compiling%20your%20own%20Multi.pdf



de la Rosa

  • Full Member
  • ***
  • Posts: 128
    • View Profile
    • Email
Re: How to create a Multi DLL with WebServer
« Reply #10 on: July 24, 2020, 02:37:04 AM »
Hi Jane,

I'm referring to Example 20 where the WebServer procedure is in the WebServer.app which is a DLL. The MainExe.app which calls the WebServer(External) procedure does not define the WebServer prototype in its procedure property and it compiles and runs fine.

I made my own test Multi DLL app but it requires me to declare the WebServer prototype in the MainExe.app's Webserver (External) procedure before it compiles and resolve the External Webserver, but when the MainExe.app starts, it pops an Exception Error.
 

de la Rosa

  • Full Member
  • ***
  • Posts: 128
    • View Profile
    • Email
Re: How to create a Multi DLL with WebServer
« Reply #11 on: July 25, 2020, 03:04:25 AM »
Hi Bruce and Jane,

Ok, my mistake was thinking that the WebServer Window procedure in the MultiDLL WebServer.app was a standard WebServer procedure as generated by the app wizard. So I just imported it to my own MultiDLL app and it works fine.

Thanks,
Vic