Plugin Cafe Homepage
Forum Home Forum Home > Plugin Cafe > SDK Help
  New Posts New Posts
  FAQ FAQ  Forum Search

Help needed with c4d_network.cpp

Author
Message
  Topic Search Topic Search
Arndt View Drop Down
Member
Member


Joined: 2002 Dec 15
Location: Germany
Online Status: Offline
Posts: 77
Direct Link To This Post Topic: Help needed with c4d_network.cpp
    Posted: 2015 Jun 12 at 2:10am

User Information:

Cinema 4D Version:   16 
Platform:   Windows  ;   
Language(s):     C++  ;   

---------

Hello,

we have a plugin here running fine with C4D 15 (Mac/Win) and C4D 16 (Mac).
It uses IpAddrPort tadr; from c4D_network.cpp
Compiling any subroutine with this command under C4D 15 runs fine in C4D 15 (Mac/Win) but crashes in C4D 16 (Win). The same plugin runs without problems under Mac (C4D 15 and 16).
Any ideas?
Back to Top
S_Bach View Drop Down
Forum Moderator
Forum Moderator
Avatar

Joined: 2011 Jun 27
Online Status: Offline
Posts: 1379
Direct Link To This Post Posted: 2015 Jun 12 at 6:35am
Hello,

could you please share some code that shows what exactly are you doing and that would help us to reproduce the issue?

Best wishes,
Sebastian
SDK Support Engineer
Back to Top
Arndt View Drop Down
Member
Member


Joined: 2002 Dec 15
Location: Germany
Online Status: Offline
Posts: 77
Direct Link To This Post Posted: 2015 Jun 12 at 9:05am
Hi Sebastian,

we could track it down to a simple line of code:

IpAddrPort tadr;

use this in Main for instance, compile it with C4D 15 (Windows) and let it runs with C4D 16.
It crashes C4D here on Windows. The same code on a Mac (also compiled with C4D 15) runs without problems.
Back to Top
NiklasR View Drop Down
Member
Member


Joined: 2010 Dec 13
Location: Germany
Online Status: Offline
Posts: 2575
Direct Link To This Post Posted: 2015 Jun 12 at 9:12am
Do you declare it as a global variable (or as part of a structure which is declared as a global variable)
or in a function?


Edited by NiklasR - 2015 Jun 12 at 9:12am
Back to Top
MohamedSakr View Drop Down
Member
Member
Avatar

Joined: 2012 Sep 17
Location: Egypt
Online Status: Offline
Posts: 577
Direct Link To This Post Posted: 2015 Jun 12 at 11:19am
this line explains it "compile it with C4D 15 (Windows) and let it runs with C4D 16."
may be internally on windows it got changes, and on Mac it is the same.
cheers,
Mohamed Sakr
Back to Top
anheiser View Drop Down
Member
Member


Joined: 2005 Oct 23
Location: Germany
Online Status: Offline
Posts: 6
Direct Link To This Post Posted: 2015 Jun 13 at 7:50am
It is declared inside a function.

Here is the code example.

#include "c4d_network.h" // R15

TcpConnection* winOpenListener(UInt32 ipAddr, int port, BaseThread* thread, Int32 timeout, Bool dontwait, Int32* ferr)
{
     Int error=0;
     UChar a,b,c,d;

     IpAddrPort tadr; // <-- Crash

     return NULL;
}

The same is happened when I want to create an instance of IpAddrPort with the Standard constructor in PluginStart() as shown below.

Bool PluginStart(void)
{
        IpAddrPort tadr;
        ...
}

Note, the problem comes with Windows only, MAC OS seems to be ok.
Code was compiled on R15 but crashes on R16.

Andre
Back to Top
S_Bach View Drop Down
Forum Moderator
Forum Moderator
Avatar

Joined: 2011 Jun 27
Online Status: Offline
Posts: 1379
Direct Link To This Post Posted: 2015 Jun 17 at 9:50am
Hello,

in R16 IpAddrPort was replaced with NetworkIpAddrPort. So you have to update your code and recompile your plugin with R16.

Best wishes,
Sebastian
SDK Support Engineer
Back to Top
S_Bach View Drop Down
Forum Moderator
Forum Moderator
Avatar

Joined: 2011 Jun 27
Online Status: Offline
Posts: 1379
Direct Link To This Post Posted: 2015 Jul 03 at 9:29am
Hello Arndt,

was your question answered?

Best wishes,
Sebastian
SDK Support Engineer
Back to Top

Forum Jump Forum Permissions View Drop Down

Bulletin Board Software by Web Wiz Forums® version 9.61 [Free Express Edition]
Copyright ©2001-2009 Web Wiz

This page was generated in 0.109 seconds.