小编Ben*_*avi的帖子

C2059语法错误'string'?

extern "C" 
{
#endif
#include <stdint.h>
#include <limits.h>
#include "attributes.h"
}
#endif
Run Code Online (Sandbox Code Playgroud)

我添加了extern "C" { } 然后我得到了C2059 string错误所以我试图使用#endif,现在我有另外4个错误.

Error   1   error C2059: syntax error : 'string'    d:\c-sharp\c++ 
compiling\consoleapplication7\consoleapplication7\libavutil\rational.h 31 1
ConsoleApplication7
Run Code Online (Sandbox Code Playgroud)

我该如何修复此字符串错误?

c c++

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

如何使效果仅在移动鼠标时显示?

我已经从这里下载了放大镜玻璃效果的源​​代码文件:

http://www.codeproject.com/Articles/18235/Simple-Magnifier

这是主要的表单代码:

///----------------------------------------------------------------------------
/// Class     : MagnifierMainForm
/// Purpose   : Provide simple magnifier. 
/// Written by: Ogun TIGLI
/// History   : 31 May 2006/Wed starting date.
///             22 Dec 2006/Fri minor code fixes and hotsot support addition.
///             01 Apr 2007/Sun XML serialization support added.
///             
/// Notes: 
/// This software is provided 'as-is', without any express or implied 
/// warranty. In no event will the author be held liable for any damages 
/// arising from the use of …
Run Code Online (Sandbox Code Playgroud)

c#

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

我在哪里可以找到System.Windows.Media?媒体不存在

我试过了:

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;
using AviFile;
using ScreenShotDemo;
using System.Threading;
using System.Windows.
Run Code Online (Sandbox Code Playgroud)

在我的新班级但在底层系统.Windows.没有媒体

我使用visual c#pro 2012和.net 4.5尝试添加它作为参考在.net和COM中寻找它但它不在那里.

我需要它的原因是在我的代码中我有PixelFormat并且它不存在:

Bitmap bmpScreenShot = new Bitmap(currentScreen.Bounds.Width,
currentScreen.Bounds.Height,
PixelFormat.Format32bppArgb);
Run Code Online (Sandbox Code Playgroud)

PixelFormat不存在.

c#

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

如何用c语言声明文件名?

我有这个c模块:

#include "stdafx.h"
#include "targetver.h"

#include "libavutil\mathematics.h"
#include "libavcodec\avcodec.h"

FILE fileName;
Run Code Online (Sandbox Code Playgroud)

我做了文件fileName;

这我有init函数:

void init(const char *filename)
{
    fileName = filename;
    avcodec_register_all();
    printf("Encode video file %s\n", fileName);
Run Code Online (Sandbox Code Playgroud)

所以我做了fileName = filename; 我做的原因是我有另一个函数我叫做start():

void start()
{
    /* open it */
    if (avcodec_open2(c, codec, NULL) < 0) {
        fprintf(stderr, "Could not open codec\n");
        exit(1);
    }
//    f = fopen(filename, "wb");
    errn = fopen_s(&f,fileName, "wb");

    if (!f) {
        fprintf(stderr, "Could not open %s\n", fileName);
        exit(1);
    }
}
Run Code Online (Sandbox Code Playgroud)

在开始我有文件名但它没有找到它所以我想使用fileName而不是.但我现在得到的错误很少:

在这一行:fileName = filename; 在=符号我得到红线错误:

错误1错误C2440:'=':无法从'const char*'转换为'FILE' …

c

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

标签 统计

c ×2

c# ×2

c++ ×1