能力值:
( LV12,RANK:530 )
|
-
-
2 楼
一个解决方法我想可以象EXE一样动态创建.呵呵,就是麻烦了点
我刚开始学的SDK编程,也不一定正确.
|
能力值:
(RANK: )
|
-
-
3 楼
谢谢楼上指点!
|
能力值:
(RANK: )
|
-
-
4 楼
有没有人有典型的教程什么的?兄弟太想学习一下了。
|
能力值:
( LV9,RANK:250 )
|
-
-
5 楼
把exe做成dll不就行了?
|
能力值:
(RANK: )
|
-
-
6 楼
哪楼上的请告诉我如何将EXE文件转化为DLL呢?又如何在其他的EXE文件中使用其中的资源?
|
能力值:
( LV12,RANK:210 )
|
-
-
7 楼
Exe和Dll文件本来都是一样的PE文件, 只不过文件头中的属性位不同决定了它们的用途不同. 至于在Dll中创建窗口问题, 实际上和Exe文件没有太大的区别, 可以把exe文件的源代码原样拷贝并稍做修改后插入Dll的代码里. 或者是在Dll中创建一个线程建立一个窗口
|
能力值:
(RANK: )
|
-
-
8 楼
楼上的大侠能不能给个例子?
|
能力值:
( LV4,RANK:50 )
|
-
-
9 楼
有窗体与没窗体差不多的编写方法啊!
调用方式也差不多
|
能力值:
( LV12,RANK:450 )
|
-
-
10 楼
下面给出实例:(部分)
library stock;
uses
IstodbDM in 'IstodbDM.pas' {IstoDM: TDataModule},
istoch in 'istoch.pas' {istoch_Form},
......
......
IstochDM in 'IstochDM.pas' {DataModule1: TDataModule};
{$R *.RES}
exports
showistochform, //In istoch.pas 库存修改
......
......
showistopdform; //In istopd.pas 库存货品盘点
begin
end.
unit istoch;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
DBCtrls, StdCtrls, Buttons, ExtCtrls, Grids, DBGrids, UserDlg, Db,
ComCtrls;
type
Tistoch_Form = class(TForm)
InstoreIdGrid: TDBGrid;
Panel1: TPanel;
Panel2: TPanel;
findBtn: TBitBtn;
amendAllBtn: TBitBtn;
delBtn: TBitBtn;
exitBtn: TBitBtn;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
Label5: TLabel;
Label6: TLabel;
Label7: TLabel;
Label8: TLabel;
Label9: TLabel;
Label10: TLabel;
ModalText: TDBText;
ClassifycodeText: TDBText;
stocknameText: TDBText;
EngineText: TDBText;
TradePriceText: TDBText;
CannibalizeText: TDBText;
ManufacturerText: TDBText;
ProducingAreaText: TDBText;
PriceLimitText: TDBText;
DiscountLimitText: TDBText;
InstorehouseDlg: TUserDlg;
amendAttrNumBtn: TBitBtn;
amendPrice: TBitBtn;
amendLocation: TBitBtn;
amendbatchBtn: TBitBtn;
Label11: TLabel;
PositionCodeText: TDBText;
StatusBar1: TStatusBar;
procedure exitBtnClick(Sender: TObject);
procedure amendAllBtnClick(Sender: TObject);
procedure delBtnClick(Sender: TObject);
procedure findBtnClick(Sender: TObject);
procedure FormKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
procedure FormCreate(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure amendAttrNumBtnClick(Sender: TObject);
procedure amendPriceClick(Sender: TObject);
procedure amendLocationClick(Sender: TObject);
procedure amendbatchBtnClick(Sender: TObject);
procedure InstoreIdGridDblClick(Sender: TObject);
procedure ShowHint(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
istoch_Form: Tistoch_Form;
procedure showistochform(apphand: Thandle; dbpath, dbpassword: string); stdcall;
implementation
uses Istoquerypart, IstodbDM, istochalledit, Istochsumall,
Istochpriceall, Istochpositionall, istochbat, IstochbF6E;
{$R *.DFM}
procedure showistochform(apphand: Thandle; dbpath, dbpassword: string); stdcall; export;
var
oldhandle: Thandle;
begin
dbpathname := dbpath;
dbpasswd := dbpassword;
oldhandle := application.Handle;
{保存动态链接库应用句柄}
application.Handle := apphand;
{动态链接库句柄置成主应用程序句柄}
istoch_Form := Tistoch_Form.Create(application);
with istoch_Form do
begin
try
showmodal;
finally
application.Handle := oldhandle;
{恢复动态链接库句柄}
free;
end;
end;
end;
procedure Tistoch_Form.FormCreate(Sender: TObject);
begin
Application.OnHint := ShowHint;
IstoDM := TIstoDM.Create(Self);
with IstoDM do
begin
TempinstorehouseQuery.Active := True;
PartPropInstorehouseQueryTable.Active := True;
end;
end;
procedure Tistoch_Form.exitBtnClick(Sender: TObject);
begin
CLOSE;
end;
procedure Tistoch_Form.amendAllBtnClick(Sender: TObject);
begin
screen.cursor := crHourGlass;
istochalledit_form := Tistochalledit_form.Create(application);
with istochalledit_form do
begin
showmodal;
free;
end;
screen.Cursor := crDefault;
InstoreIdGrid.SetFocus;
end;
procedure Tistoch_Form.amendAttrNumBtnClick(Sender: TObject);
begin
screen.cursor := crHourGlass;
istochsumall_Form := Tistochsumall_Form.Create(Application);
with istochsumall_Form do
begin
showmodal;
free;
end;
screen.Cursor := crDefault;
InstoreIdGrid.SetFocus;
end;
procedure Tistoch_Form.amendPriceClick(Sender: TObject);
begin
screen.cursor := crHourGlass;
Istochpriceall_Form := TIstochpriceall_Form.Create(Application);
with Istochpriceall_Form do
begin
showmodal;
free;
end;
screen.Cursor := crDefault;
InstoreIdGrid.SetFocus;
end;
procedure Tistoch_Form.amendLocationClick(Sender: TObject);
begin
screen.cursor := crHourGlass;
Istochpositionall_Form := TIstochpositionall_Form.Create(Application);
with Istochpositionall_Form do
begin
showmodal;
free;
end;
screen.Cursor := crDefault;
InstoreIdGrid.SetFocus;
end;
procedure Tistoch_Form.amendbatchBtnClick(Sender: TObject);
begin
hide;
screen.cursor := crHourGlass;
Istochbat_Form := TIstochbat_Form.Create(Application);
with Istochbat_Form do
begin
showmodal;
free;
end;
Application.OnHint := ShowHint;
screen.Cursor := crDefault;
show;
end;
procedure Tistoch_Form.delBtnClick(Sender: TObject);
begin
with InstorehouseDlg do
begin
title := '警告';
message.Clear;
message.Add('您要删除当前记录,是否继续?');
buttons.Clear;
buttons.Add('确定');
buttons.Add('放弃');
icon := icWarning;
if show = 0 then
begin
istoDM.InstorehouseQuery.edit;
istoDM.InstorehouseQuery.delete;
end;
end;
end;
procedure Tistoch_Form.findBtnClick(Sender: TObject);
var
i: integer;
elementstr: string;
elementname: string;
attribstr: string;
descript: string;
elements: Tstrings;
begin
screen.Cursor := crHourGlass;
elements := Tstringlist.Create;
with IstoDM do
begin
for i := 0 to TempinstorehouseQuery.FieldCount - 26 do
begin
elementname := TempinstorehouseQuery.Fields[i].FieldName;
attribstr := getattrib(TempinstorehouseQuery.Fields[i].DataType);
descript := TempinstorehouseQuery.Fields[i].DisplayLabel;
elementstr := elementname + ':' + attribstr + ':' + descript;
elements.Add(elementstr);
end;
with TIstoqueryDlg.Create(self, elements) do
begin
if showmodal = mrOk then
begin
InstoreIdGrid.SetFocus;
end;
free;
end;
end;
show;
elements.Free;
screen.Cursor := crDefault;
end;
procedure Tistoch_Form.FormKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
begin
case key of
VK_RETURN: amendAllBtnClick(amendAllBtn);
VK_DELETE: DelBtnclick(DelBtn);
VK_ESCAPE: ExitBtnClick(ExitBtn);
end;
end;
procedure Tistoch_Form.FormClose(Sender: TObject;
var Action: TCloseAction);
begin
IstoDM.free;
IstoDM := nil;
Application.OnHint := nil;
Action := caFree;
istoch_Form := nil;
end;
procedure Tistoch_Form.InstoreIdGridDblClick(Sender: TObject);
begin
amendAllBtnClick(amendAllBtn);
end;
procedure Tistoch_Form.ShowHint(Sender: TObject);
begin
StatusBar1.Panels[0].Text := Application.Hint;
end;
end.
其他的类似
|
能力值:
(RANK: )
|
-
-
11 楼
感激楼上给出的DELPHI的例子,太棒了,回去一定仔细研究!
再次感谢!!
坛子里的朋友真不错,这么热心! 谁要是有个MASM32的例子就更好了!
|
|
|