c++

0012

Member
مدتی بود که دنبال گزاشت skin روی Dialog ها بودم بعد از مدتی یه همچین آموزشی پیدا کردم که با c++ میشه رو Dialog ها skin گذاشت میشه متن زیر رو بخونید و بگید که من درست پیدا کردم یا نه
میشه بگید که resource editor کجا هستش
اگه براتون امکان داره یه توضیحی در این باره لطف کنید.
منونم



HOWTO: Create a Skinned Custom Dialog

Document ID: Q107767
Last Revised On: Tuesday, February 11, 2003

This article applies to the following:
Product(s):
InstallShield Professional 7.x


Summary

If you want to skin an existing custom dialog box (migrated from a previous version of Professional), there are some changes required to the dialog in order for it to be properly skinned. There is also a template available to help create a custom dialog that will be properly skinned.

Discussion

Modifying an existing custom dialog for skins

Modify the custom dialog resource in _IsUser.dll using a resource editor. For example, Microsoft Visual C++.

1. Open the resource editor (MS VC++).

2. Select File > Open.

3. Set the Open as: field to Resources.

4. Browse to the resource DLL that contains the existing custom dialog ( _IsUser.dll).

5. Select the file and click Open.

6. Expand to the dialog resource under _IsUser.dll\Dialog.

7. Double-click the appropriate Dialog ID to open the dialog for editing.

8. Resize the dialog to 460 x 305.

9. Rearrange the default push buttons to match a skinned dialog (see below).

10. If the dialog contains the Windows 2000 style white banner, delete this control (it usually has a resource ID of 52)

11. Rearrange dialog controls to be spaced out in relation to a bigger dialog.

12. Select File > Save.

13. Reinsert the updated _IsUser.dll into the Professional project:

1. Select the Setup Files tab > Language Independent > OS Independent.

2. Right-click in the right pane and select Import Files.

3. Browse to your file and click Open.

Create a new custom dialog box to be skinned

Create a custom dialog that can be skinned, using a resource editor and the available template.

1. Copy the VC++ 6 Project folder and all its contents and subfolders to a working folder. This working folder is located in \Examples\Custom Dialog\VC++ 6 Project. This keeps your InstallShield folders "clean" and ready for a complete uninstallation should you ever want to uninstall InstallShield and preserves the original files for future custom dialog projects.

2. Open the resource editor.

3. Select File > Open.

4. Open the _IsUser.dsp file in your working VC++ 6 Project folder. If the Project Workspace is not in view, select it from the View menu.

5. Modify the template titled DLG_TEMPLATE3 for a skinned custom dialog.

6. For sample custom dialog script, open \Examples\Custom Dialog\Script Files
 
سلام.

مقاله رو به نظرم درست انتخاب کردید. اما باید بگم که من MSC VC 6 رو ندارم. تو VS .NET نگاه کردم و میشه رو قسمت Open از توی انواع فایل توی Open Dialog قسمت Browse Resources رو انتخاب کرد که فقط فایل های resource رو بیاره ...
 

jopeter

Member
الگوريتم فشرده سازي هافمن

سلام
من يک برنامه نوشتم در مرده کد گذاری درخته هافمن
بايد فايلی رو از کامپيوتر بخونم و درخته هافمنش رو تشکيل بدم
ميدونم حلقم اشکال داره
اصلاً نميدونم چرا برنامه حتی نميتونه فايلو باز کنه
يعنی برنامه به قسمت حلّقه نميرسه
ببينين تو تابع مين تا خط
(s->start->info)++;}
پايين بيان
تا اين جا من ارايه
arc
را از سيمبل ها و تعداده تکرار اونا پر کردم
و در يک صف الويت دار مرتب کردم
هر کاراکتری که تعداد تکرار کمتری داره الويتی بيشتر داره

من تو حلقه
while(pq.getinfo()>1)
بايد
دو عنصر اوله موجود در صف الويت دار رو بر دارم و وزن اونا رو با هم جم کنم
و با تابع
maketree
درخته هفمن رو بسازم

#include<iostream.h>
#include<stdlib.h>
#include<conio.h>
#include<fstream.h>
#define M 20
//***********************
int i,j;
class arc{
public:
char ch;
int fr;
arc(){
ch=NULL;
fr=0;};
void inc(){fr++;};
};
class binnode{
public:
friend class hufftree;
binnode *left;
binnode *right;
binnode *father;
int freq;
char sym;
};
//***********************
class hufftree{
public:
hufftree();
void maketree(int x,int y,char,char);
void printcode();
binnode *root;
};
//***********************
class stack{
public:
friend void hufftree::printcode();
stack();
int empty();
int mytop;
binnode *item[M];
};
//***********************
stack::stack()
{mytop=-1;
}
//***********************
int stack::empty()
{if(mytop==-1)
return 1;
else
return 0;
}
//***********************
hufftree::hufftree()
{root=NULL;
}
//***********************
void hufftree::maketree(int x,int y,char symbol1,char symbol2)
{binnode *p1,*p2,*p;
p1=new binnode;
p2=new binnode;
p=new binnode;
p->freq=x+y;
p1->freq=x;
p1->sym=symbol1;
p1->left=p1->right=NULL;
p2->freq=y;
p2->sym=symbol2;
p2->left=p2->right=NULL;
p->left=p1;
p->right=p2;
p->father=NULL;
p1->father=p2->father=p;
if(root==NULL)
root=p;
else
{ if(p1->freq==root->freq)
{p1->left=root->left;
p1->right=root->right;
p1->left->father=p1->right->father=p1;
delete root;
root=p;}
else
{p2->left=root->left;
p2->right=root->right;
p2->left->father=p2->right->father=p2;
delete root;
root=p;
}}}
//***********************
void hufftree::printcode()
{int code[M],k,j;
binnode *p1,*q,*p=root;
stack s;
cout<<"code is:";
do
{while(p!=NULL)
{s.item[++(s.mytop)]=p;
p=p->left;
}
if(!s.empty())
{p=s.item[(s.mytop)--];
if(p->right==NULL)
{k=M-1;
p1=p;
while(p1!=NULL)
{q=p1->father;
if(q->left==p1)
code[k--]=1;
else
code[k--]=0;
p1=q;}
cout<<p->sym<<"=";
for(j=k+2;j<M;j++)
cout<<code[j];
cout<<"\n";
}
p=p->right;}
}
while(!s.empty()||p!=NULL);
}
//***********************
class qnode{
public:
friend class queue;
qnode *next;
int info;
char sym;
};
//***********************
class queue{
public:
queue();
int getinfo(){return start->info;};
void pqinsert(int num,char symbol);
qnode *start;
};
//*********************
queue::queue()
{
start=new qnode;
start->next=NULL;
start->info=0;
start->sym=NULL;
}
//*********************
void queue::pqinsert(int num,char symbol)
{
qnode *p,*q,*h;
q=new qnode;
q->next=NULL;
q->info=num;
q->sym=symbol;
p=start;
h=start->next;
while(h!=NULL)
{if(q->info>h->info)
{p=h;
h=h->next;}
else
break;
}
q->next=h;
p->next=q;
(start->info)++;
}
//*********************
void main()
{
char symbol1,symbol2,cha;
arc o[256];
queue pq,*s=NULL;
qnode *p=NULL,*q=NULL,*h=NULL,*g=NULL,*v=NULL;
hufftree hf;
int num1,num2;
fstream infile;
infile.open("azmayesh.txt",ios::in);
if(!infile)
{cout<<"can not open file";
exit(1);
}
infile.unsetf(ios::skipws);
infile>>cha;
do {
for(i=0;i<256;i++)
{for(j=0;j<256&&(o[j].ch)!=cha;j++);
if(j==256)
{o.ch=cha;
o.inc();}
else
o[j].inc(); }
infile>>cha;}while(cha!='.');
infile.close();
for(i=0;(o.ch)!=NULL;i++)
{
q=new qnode;
q->next=NULL;
q->info=o.fr;
q->sym=o.ch;
p=s->start;
h=s->start->next;
while(h!=NULL)
{if(q->info>h->info)
{p=h;
h=h->next;}
else
break;
}
q->next=h;
p->next=q;
(s->start->info)++;}
while(pq.getinfo()>1)
{
if(s->start->info>0)
{(s->start->info)--;
g=s->start->next;
num1=s->start->next->info;
symbol1=s->start->next->sym;
s->start->next=g->next;
}
if(s->start->info>0)
{(s->start->info)--;
v=s->start->next;
num2=s->start->next->info;
symbol2=s->start->next->sym;
s->start->next=v->next;
}
hf.maketree(num1,num2,symbol1,symbol2);
pq.pqinsert(num1+num2,'*');
}
hf.printcode();
getch();
}
 

جدیدترین ارسال ها

بالا