eksportowanie struktur

0

Jak eksportować do dll-ki struktury?

0

A jak zawrapować coś takiego?

struct pjsip_cred_info
{
    pj_str_t    realm;		/**< Realm. Use "*" to make a credential that
				     can be used to authenticate against any
				     challenges.			    */
    pj_str_t	scheme;		/**< Scheme (e.g. "digest").		    */
    pj_str_t	username;	/**< User name.				    */
    int		data_type;	/**< Type of data (0 for plaintext passwd). */
    pj_str_t	data;		/**< The data, which can be a plaintext 
				     password or a hashed digest.	    */

    /** Extended data */
    union {
	/** Digest AKA credential information. Note that when AKA credential
	 *  is being used, the \a data field of this #pjsip_cred_info is
	 *  not used, but it still must be initialized to an empty string.
	 * Please see \ref PJSIP_AUTH_AKA_API for more information.
	 */
	struct {
	    pj_str_t	  k;	/**< Permanent subscriber key.		*/
	    pj_str_t	  op;	/**< Operator variant key.		*/
	    pj_str_t	  amf;	/**< Authentication Management Field	*/
	    pjsip_cred_cb cb;	/**< Callback to create AKA digest.	*/
	} aka;

    } ext;
}; 
0

Definicji struktur nie eksportujesz. Dołączasz do programu, który korzysta z biblioteki plik nagłówkowy z tą definicją i tyle.

0

ale tą powyższą strukturę muszę jakoś przepisać na c#. Pytanie tylko jak to zrobić skoro struktury w c# mogą mieć tylko typy proste

To dlaczego od razu nie napiszesz że potrzebujesz struktury w C#?

Powiedz co to jest to pj_str_t i pjsip_cred_cb.

0

Ah, już widzę. To taki nietypowy string.
W C# najlepiej byłoby dać po prostu string i pobawić się w custom marshalling.

0

wie ktoś jak eksportować powyższą strukturę do c#?

1 użytkowników online, w tym zalogowanych: 0, gości: 1