24小时热门版块排行榜    

查看: 7741  |  回复: 145
本帖产生 1 个 程序强帖 ,点击这里进行查看

bbettry

铜虫 (初入文坛)

送红花一朵
终于找到组织了
目标:顶级工程师
131楼2013-12-04 09:57:42
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

卡卡西耶

木虫 (正式写手)


小木虫: 金币+0.5, 给个红包,谢谢回帖
楼主,你好 我想学习下vb调用refprop软件!!该怎么办,完全木有思路和资料。。vb也不是很懂!!
132楼2014-01-14 21:36:14
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

biowhb

银虫 (正式写手)


小木虫: 金币+0.5, 给个红包,谢谢回帖
初学windows编程:想把一个主窗体的客户区分割成三个部分,下面是代码,运行起来却仍是空白的没什么变化,这是为何?求大神指点
#include <windows.h>

#define ID_FIRSTCHILD  100
#define ID_SECONDCHILD 101
#define ID_THIRDCHILD  102

// Global variable

HINSTANCE hinst;

// Function prototypes.

int WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int);
InitApplication(HINSTANCE);
InitInstance(HINSTANCE, int);
LRESULT CALLBACK MainWndProc(HWND, UINT, WPARAM, LPARAM);
BOOL CALLBACK EnumChildProc(HWND , LPARAM ) ;

// Application entry point.

int WINAPI WinMain(HINSTANCE hinstance, HINSTANCE hPrevInstance,
    LPSTR lpCmdLine, int nCmdShow)
{
    MSG msg;

    if (!InitApplication(hinstance))
        return FALSE;

    if (!InitInstance(hinstance, nCmdShow))
        return FALSE;

    while (GetMessage(&msg, (HWND) NULL, 0, 0) != 0 && GetMessage(&msg, (HWND) NULL, 0, 0) != -1)
    {
        TranslateMessage(&msg);
        DispatchMessage(&msg);
    }
    return msg.wParam;
        UNREFERENCED_PARAMETER(lpCmdLine);
}

BOOL InitApplication(HINSTANCE hinstance)
{
    WNDCLASSEX wcx;

    // Fill in the window class structure with parameters
    // that describe the main window.

    wcx.cbSize = sizeof(wcx);          // size of structure
    wcx.style = CS_HREDRAW |
        CS_VREDRAW;                    // redraw if size changes
    wcx.lpfnWndProc = MainWndProc;     // points to window procedure
    wcx.cbClsExtra = 0;                // no extra class memory
    wcx.cbWndExtra = 0;                // no extra window memory
    wcx.hInstance = hinstance;         // handle to instance
    wcx.hIcon = LoadIcon(NULL,
        IDI_APPLICATION);              // predefined app. icon
    wcx.hCursor = LoadCursor(NULL,
        IDC_ARROW);                    // predefined arrow
    wcx.hbrBackground = (HBRUSH)GetStockObject(
        WHITE_BRUSH);                  // white background brush
    wcx.lpszMenuName =  "MainMenu";    // name of menu resource
    wcx.lpszClassName = "MainWClass";  // name of window class
    wcx.hIconSm = NULL;

    // Register the window class.

    return RegisterClassEx(&wcx);
}

BOOL InitInstance(HINSTANCE hinstance, int nCmdShow)
{
    HWND hwnd;

    // Save the application-instance handle.

    hinst = hinstance;

    // Create the main window.

    hwnd = CreateWindow(
        "MainWClass",        // name of window class
        "Sample",            // title-bar string
        WS_OVERLAPPEDWINDOW, // top-level window
        CW_USEDEFAULT,       // default horizontal position
        CW_USEDEFAULT,       // default vertical position
        CW_USEDEFAULT,       // default width
        CW_USEDEFAULT,       // default height
        (HWND) NULL,         // no owner window
        (HMENU) NULL,        // use class menu
        hinstance,           // handle to application instance
        (LPVOID) NULL);      // no window-creation data

    if (!hwnd)
        return FALSE;

    // Show the window and send a WM_PAINT message to the window
    // procedure.

    ShowWindow(hwnd, nCmdShow);
    UpdateWindow(hwnd);
    return TRUE;

}

LONG APIENTRY MainWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
    RECT rcClient;
    int i;

    switch(uMsg)
    {
        case WM_CREATE: // creating main window  

            // Create three invisible child windows.

            for (i = 0; i < 3; i++)
            {
                CreateWindowEx(
                    0,
                    "ChildWClass",
                    (LPCTSTR) NULL,
                    WS_CHILD | WS_BORDER,
                    0,0,0,0,
                    hwnd,
                    (HMENU) (int) (ID_FIRSTCHILD + i),
                    hinst,
                    NULL);
            }

            return 0;

        case WM_SIZE:   // main window changed size

            // Get the dimensions of the main window's client
            // area, and enumerate the child windows. Pass the
            // dimensions to the child windows during enumeration.

            GetClientRect(hwnd, &rcClient);
            EnumChildWindows(hwnd, EnumChildProc,
                (LPARAM) &rcClient);
            return 0;
        // Process other messages.

    }
    return DefWindowProc(hwnd, uMsg, wParam, lParam);
}

BOOL CALLBACK EnumChildProc(HWND hwndChild, LPARAM lParam)
{
    LPRECT rcParent;
    int i, idChild;

    // Retrieve the child-window identifier. Use it to set the
    // position of the child window.

    idChild = GetWindowLong(hwndChild, GWL_ID);

    if (idChild == ID_FIRSTCHILD)
        i = 0;
    else if (idChild == ID_SECONDCHILD)
        i = 1;
    else
        i = 2;

    // Size and position the child window.  

    rcParent = (LPRECT) lParam;
    MoveWindow(hwndChild,
        (rcParent->right / 3) * i,
        0,
        rcParent->right / 3,
        rcParent->bottom,
        TRUE);

    // Make sure the child window is visible.

    ShowWindow(hwndChild, SW_SHOW);

    return TRUE;
}
生物技术-基因工程制药
133楼2014-02-13 15:26:09
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

巴厘岛蓝山

新虫 (初入文坛)


小木虫: 金币+0.5, 给个红包,谢谢回帖
在C++中 从形参传入一个字符,将该字符从字符串中删除。
这是我的代码  但是不知道哪里错了  前辈能不能帮我指出来  谢谢了  另外怎么对字符串数组进行动态内存分配   
#include<iostream>
#include<Cstring>
using namespace std;
void remove(char string1[],char p)
{
        int i,j=0;
        char string2[10];
        for(i=0;i<strlen(string1);i++)
        {
                if(string1==p)
                        i++;
                else
                        string2[j++]=string1;
        }
        for(j=0;j<strlen(string2);j++)
                cout<<string2[j];
        cout<<endl;
}

int main()
{
        char string1[10];
        char p;
        gets(string1);
        cin>>p;
        remove(string1,p);
        return 0;
}
134楼2014-03-08 15:21:28
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

自来清风

银虫 (小有名气)


小木虫: 金币+0.5, 给个红包,谢谢回帖
引用回帖:
134楼: Originally posted by 巴厘岛蓝山 at 2014-03-08 15:21:28
在C++中 从形参传入一个字符,将该字符从字符串中删除。
这是我的代码  但是不知道哪里错了  前辈能不能帮我指出来  谢谢了  另外怎么对字符串数组进行动态内存分配   
#include<iostream>
#include<Cs ...

void remove(char string1[],char p)
{
        int i,j=0;
        char string2[10];
        for(i=0;i<strlen(string1);i++)
        {
                if(string1==p)
                        i++;
                else
                        string2[j++]=string1;
        }
这一段有问题。
1. if(string1==p)  中的string1是首地址,不是字符内容。
2.for循环里面的i++是干嘛的?
改成   
int j=0;
for(int i=0;i<strlen(string1);i++)
        {
                if(string1!=p)
                 tring2[j++]=string1;
        }
内存分配用new或malloc(看情况选择)
135楼2014-04-07 20:36:35
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

ylqc169

新虫 (初入文坛)


小木虫: 金币+0.5, 给个红包,谢谢回帖
刚开始学C# 很有挑战
136楼2014-05-05 10:08:25
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

cswfpp

新虫 (初入文坛)


小木虫: 金币+0.5, 给个红包,谢谢回帖
楼主你好,我最近在编写一个动态规划的程序,因为没有学过MATLAB,所以想用稍微了解些的C++。因为我的决策变量是二维的,所以不知道该怎么下手。麻烦问一下,如果用C++ 解线性规划,是不是必须要设计算法,而没有直接可用的工具箱?
PS:让x(i,j)为二维的决策变量,如果我给模型添加约束x(i,j)*x(j,i)=0,是不是就变成了非线性规划。
137楼2014-06-21 10:14:41
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

huzhao_hua

至尊木虫 (著名写手)


小木虫: 金币+0.5, 给个红包,谢谢回帖
引用回帖:
8楼: Originally posted by 波不动 at 2009-11-25 13:34:49
还是没人问问题的话,那我来问一个问题。

就是平时自己编了一个函数方法之类的东西,如何把它封装成DLL,有什么条件没?以便以后可以随时调用。因为我看见我们老师就是这么用的。他编的FFT程序,就是一个dll文件 ...

这应该要功能相同吧,要是不相同,还真不行,我用的是C#和SQL
快乐是我的本性,真诚更是我的本性!
138楼2014-07-16 15:20:12
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

my12321

新虫 (初入文坛)


小木虫: 金币+0.5, 给个红包,谢谢回帖
利用VS2010环境和C#语言编程实现图表控件的示例演示,完成坐标可调、坐标平移、曲线缩放、曲线滚动、添加图表题目、编辑横纵坐标等功能。     这个如何实现啊
139楼2014-08-16 10:17:53
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

明天不上课

木虫 (正式写手)

不说话


小木虫: 金币+0.5, 给个红包,谢谢回帖
楼主你好,我刚学c#不久,现在是想用一个winform控制一个电化学工作站的一个测试方法,实现在一定时间后的数据采集和结果保存的工作,不知可否提供一下思路,有什么推荐教程之类的?
每天都要奋斗
140楼2014-10-20 08:44:29
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
相关版块跳转 我要订阅楼主 magic7004 的主题更新
普通表情 高级回复 (可上传附件)
信息提示
请填处理意见