小编Shy*_*hah的帖子

如何在java上使用PJSIP等C库?

有没有办法从C编译的库中使用和调用方法调用,如PJSIP库?

我想使用和调用我编译的pjsip lib中的调用,但显而易见的问题是pjsip是一个C库而不是一个java库,即一个jar文件.

可能?也许是JNI?

谢谢

编辑:尝试使用Swig来完成手头的任务,但它只是创建一个空的类文件.

这是我用来执行swig的命令:

swig  -verbose -java -package com.josh.sip.util -o jni_wrapper.c pjsua.i
Run Code Online (Sandbox Code Playgroud)

swig命令输出

    Language subdirectory: java
Search paths:
   .\
   .\swig_lib\java\
   C:\Users\jonney\Downloads\swigwin-2.0.9\Lib\java\
   .\swig_lib\
   C:\Users\jonney\Downloads\swigwin-2.0.9\Lib\
Preprocessing...
Starting language-specific parse...
Processing types...
C++ analysis...
Generating wrappers...
Run Code Online (Sandbox Code Playgroud)

它为我创建的pjsua java类:

    /* ----------------------------------------------------------------------------
 * This file was automatically generated by SWIG (http://www.swig.org).
 * Version 2.0.9
 *
 * Do not make changes to this file unless you know what you are doing--modify
 * the SWIG interface file instead.
 * ----------------------------------------------------------------------------- */

package com.josh.sip.util;

public …
Run Code Online (Sandbox Code Playgroud)

java java-native-interface pjsip

8
推荐指数
1
解决办法
3841
查看次数

将docx转换为pdf - 免费

我已经看到很多这方面的问题,但仍然找不到我的答案.

我希望能够在没有安装单词的情况下将docx文件转换为文件pdf.那里可能有免费的图书馆吗?我真的不想为此付出代价.我读了一篇文章XSL-FO,我发现了一个XSL-FOpdf转换库,不知道是否有效.

所以没有使用Microsoft.Office.Interop.Word我想转换docxpdf

c# pdf converter docx

6
推荐指数
0
解决办法
2100
查看次数

WPF DataContext不使用MVVM模型刷新DataGrid

项目概况

我有一个视图绑定到包含2 ObserverableCollection的viewmodel.viewmodel构造函数填充第一个ObserverableCollection,并收集视图datacontext以通过名为Sites的公共属性绑定到它.

稍后,在LoadOrders方法中填充2ed ObserverableCollection,并更新公共属性LoadFraudResults以将其与datacontext绑定.

我正在使用WCF从数据库中提取数据并将其拉得非常好.

VIEWMODEL来源

class ManageFraudOrderViewModel:ViewModelBase 
{
    #region Fields        
    private readonly ICollectionView collectionViewSites;
private readonly ICollectionView collectionView;
    private ObservableCollection<GeneralAdminService.Website> _sites;
    private ObservableCollection<FraudService.OrderQueue> _LoadFraudResults;

    #endregion 

    #region Properties
    public ObservableCollection<GeneralAdminService.Website> Sites 
    {
        get { return this._sites; }
    }
    public ObservableCollection<FraudService.OrderQueue> LoadFraudResults 
    {
        get { return this._LoadFraudResults;}
    }
    #endregion

    public ManageFraudOrderViewModel()
    {
        //Get values from wfc service model
        GeneralAdminService.GeneralAdminServiceClient generalAdminServiceClient = new GeneralAdminServiceClient();
        GeneralAdminService.Website[] websites = generalAdminServiceClient.GetWebsites();
        //Get values from wfc service model            

        if (websites.Length > 0)
        {
            _sites = …
Run Code Online (Sandbox Code Playgroud)

wpf datacontext mvvm

3
推荐指数
1
解决办法
1万
查看次数

如何从textBox1文本复制到textBox2包括空格?

我有一个用户在textBox1中输入手册的文本然后一个按钮单击将文本从textBox1复制到textBox2但在textBox2中文本看起来像一个长文本.

我希望在复制文本时,它也会复制单词之间的确切空格.

在我的新课程中,我将此代码放在顶部:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ScrambleRandomWordsTest
{
    class ScrambleTextBoxText
    {
        private static readonly Random RandomGen = new Random();
        private List<string> _words;
        private List<string> _scrambledWords;

        public ScrambleTextBoxText(List<string> textBoxList)
        {
            _words = textBoxList;
        }
Run Code Online (Sandbox Code Playgroud)

然后在底部我有这个功能:

public List<string> scrambledTextBoxWords()
        {
            List<string> words = _scrambledWords;
            return words;
        }
Run Code Online (Sandbox Code Playgroud)

然后在按钮点击事件的Form1中我有:

private void BtnScrambleText_Click(object sender, EventArgs e)
        {
            textBox1.Enabled = false;
            BtnScrambleText.Enabled = false;
            textBoxWords = ExtractWords(textBox1.Text);
            ScrambleTextBoxText scrmbltb = new ScrambleTextBoxText(textBoxWords);
            for (int i = 0; …
Run Code Online (Sandbox Code Playgroud)

.net c# winforms

1
推荐指数
1
解决办法
534
查看次数

标签 统计

c# ×2

.net ×1

converter ×1

datacontext ×1

docx ×1

java ×1

java-native-interface ×1

mvvm ×1

pdf ×1

pjsip ×1

winforms ×1

wpf ×1