Forum


Notice to all users

We are migrating towards a new forum system located at community.teamspeak.com, as such this forum will become read-only on January 29, 2020

Results 1 to 6 of 6
  1. #1
    Join Date
    July 2014
    Posts
    14

    Question Plugin Loading Problem

    Hi community,

    I started to take a look at the Teamspeak 3 Plugin Development yesterday.

    After I had downloaded the latest sdk, I opened it with Microsoft Visual C++ 2010 Express. (I also tried it with Microsoft Visual Studio Express 2012 & 2013, but the error persisted.)

    Here you can see my source-code (just a simple test-code):

    Code:
    #ifdef _WIN32
    #pragma warning (disable : 4100) 
    #include <Windows.h>
    #endif
    
    #include <stdio.h>
    #include <stdlib.h>
    #include <string.h>
    #include <assert.h>
    #include "public_errors.h"
    #include "public_errors_rare.h"
    #include "public_definitions.h"
    #include "public_rare_definitions.h"
    #include "ts3_functions.h"
    #include "plugin.h"
    
    static struct TS3Functions ts3Functions;
    
    #ifdef _WIN32
    #define _strcpy(dest, destSize, src) strcpy_s(dest, destSize, src)
    #define snprintf sprintf_s
    #else
    #define _strcpy(dest, destSize, src) { strncpy(dest, src, destSize-1); (dest)[destSize-1] = '\0'; }
    #endif
    
    #define PLUGIN_API_VERSION 20
    
    #define PATH_BUFSIZE 512
    #define COMMAND_BUFSIZE 128
    #define INFODATA_BUFSIZE 128
    #define SERVERINFO_BUFSIZE 256
    #define CHANNELINFO_BUFSIZE 512
    #define RETURNCODE_BUFSIZE 128
    
    static char* pluginID = NULL;
    
    #ifdef _WIN32
    
    static int wcharToUtf8(const wchar_t* str, char** result) {
    	int outlen = WideCharToMultiByte(CP_UTF8, 0, str, -1, 0, 0, 0, 0);
    	*result = (char*)malloc(outlen);
    	if(WideCharToMultiByte(CP_UTF8, 0, str, -1, *result, outlen, 0, 0) == 0) {
    		*result = NULL;
    		return -1;
    	}
    	return 0;
    }
    #endif
    
    /*********************************** Required functions ************************************/
    
    const char* ts3plugin_name() {
    #ifdef _WIN32
    	static char* result = NULL;  
    	if(!result) {
    		const wchar_t* name = L"Support Notification";
    		if(wcharToUtf8(name, &result) == -1) { 
    			result = "Support Notification";  
    		}
    	}
    	return result;
    #else
    	return "Support Notification";
    #endif
    }
    
    const char* ts3plugin_version() {
        return "1.2";
    }
    
    int ts3plugin_apiVersion() {
    	return PLUGIN_API_VERSION;
    }
    
    const char* ts3plugin_author() {
        return "Linneprogramming";
    }
    
    const char* ts3plugin_description() {
        return "This plugin will play a notification sound, if a user requests support.";
    }
    
    void ts3plugin_setFunctionPointers(const struct TS3Functions funcs) {
        ts3Functions = funcs;
    }
    
    int ts3plugin_init() {
        char appPath[PATH_BUFSIZE];
        char resourcesPath[PATH_BUFSIZE];
        char configPath[PATH_BUFSIZE];
    	char pluginPath[PATH_BUFSIZE];
    
        printf("PLUGIN: init\n");
    
        ts3Functions.getAppPath(appPath, PATH_BUFSIZE);
        ts3Functions.getResourcesPath(resourcesPath, PATH_BUFSIZE);
        ts3Functions.getConfigPath(configPath, PATH_BUFSIZE);
    	ts3Functions.getPluginPath(pluginPath, PATH_BUFSIZE);
    
    	printf("PLUGIN: App path: %s\nResources path: %s\nConfig path: %s\nPlugin path: %s\n", appPath, resourcesPath, configPath, pluginPath);
    
        return 0; 
    }
    
    void ts3plugin_shutdown() {
    
        printf("PLUGIN: shutdown\n");
    
    	if(pluginID) {
    		free(pluginID);
    		pluginID = NULL;
    	}
    }
    
    void ts3plugin_onClientMoveEvent(uint64 serverConnectionHandlerID, anyID clientID, uint64 oldChannelID, uint64 newChannelID, int visibility, const char* moveMessage) {
    	if (newChannelID == 1)
    		ts3Functions.playWaveFile(serverConnectionHandlerID, "@(C:/Users/Workstation/Music/talkpower_requested.wav");
        if (newChannelID == 2)
    		ts3Functions.playWaveFile(serverConnectionHandlerID, "@(C:/Users/Workstation/Music/talkpower_requested.wav");
    }

    unfortunately, I faced this problem the whole time:
    Click image for larger version. 

Name:	1ei9lnv4ekv9.png 
Views:	270 
Size:	30.4 KB 
ID:	10943


    Do you guys know what I did wrong? Thanks in advance!

  2. #2
    Join Date
    September 2012
    Posts
    6,079
    Try and compile with /MT instead of /MD (Project Properties > C/C++ > Code Generation > Runtime Library) and if it doesn't work then check Dependency Walker for other libraries that your dll requires that are not available.
    When sending PMs please make sure to include a reference link to the thread in question in the body of your message.

  3. #3
    Join Date
    January 2010
    Location
    Germany
    Posts
    91
    And remember:
    1. If you're using the 32bit version of ts3 you will need to compile the plugin as 32bit.
    2. If you're using the 64bit version of ts3 you will need to compile the plugin as 64bit.

  4. #4
    Join Date
    July 2014
    Posts
    14
    I took a look at my computer and ts3 client, both are 64bit versions.

    could you be so kind to explain me how to compile a plugin as 64bit? and which program is best for this purpose? thanks in advance

  5. #5
    Join Date
    January 2010
    Location
    Germany
    Posts
    91
    i quick google search turned up this http://kb-en.radiantzemax.com/Knowle...o-Express-2010

  6. #6
    Join Date
    July 2014
    Posts
    14
    I already saw this post, but when I try to install the Microsoft Windows Software Developer Kit (SDK) 7.1 I am getting an error:

    Click image for larger version. 

Name:	9pr92tsjzic.png 
Views:	90 
Size:	117.9 KB 
ID:	10975

    Unfortunately, the error log has not been created...

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Loading Image problem
    By tking in forum General Questions
    Replies: 3
    Last Post: March 18th, 2015, 04:13 PM
  2. [HELP] Error loading plugin (Error code 193)
    By UngarMax in forum Client Plugins / Lua Scripts
    Replies: 1
    Last Post: April 14th, 2014, 03:27 PM
  3. TS3 problem and game loading
    By Vyruzzz in forum Windows
    Replies: 2
    Last Post: December 3rd, 2013, 09:59 AM
  4. Problem with plugin
    By T.S. Excreta in forum Client Plugins / Lua Scripts
    Replies: 2
    Last Post: June 16th, 2011, 07:23 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •