|
Which Version i use ... for VC++ and Operating system XP
Is there any built in for VC++
as there is in VB its own component..
wt abut VC++
thanx.
|
|
|
|
|
i don't know of any built specifically for VC++
there are other installation programs that dont' cost $$$
i don't know of a name off the top of my head, but they have been mentioned several times on CP
|
|
|
|
|
|
I want to begin a project with vc6 + sp5 + directx8,but I do not know how to beigin this!!
Any suggestion is welcome!
buaa_chenx@hotmail.com
|
|
|
|
|
First Download DirectX SDK
then study it ,, it has Samples for VC++
choose utr area on which u want to work ...
means DirectShow / DirectSound / DirectPlay etc.
i Hope SDK will Help u to Study it
GOOD LUCK
|
|
|
|
|
damn it, you beat my message by 2 mins
great minds think alike!!
|
|
|
|
|
My first step would be to get the DirectX SDK. Last I looked it had lots of samples.
DirectX 9.0 SDK[^]
|
|
|
|
|
Hi!
in the onpaint function of a dialog i've got this code:
CString temptext;
this->m_EditTexto.GetWindowText(temptext);
CSize size=dlgDC.GetTextExtent(temptext);
CRect rect;
rect.left=m_pto_pers_texto.x-size.cx/2;
rect.right=rect.left+size.cx;
rect.top=m_pto_pers_texto.y;
rect.bottom=rect.top+size.cy;
dlgDC.DrawText(temptext,-1,rect,DT_CENTER);
it's a part of a drag and drop operation, when i drag something, it writes what the user inserts.
if i drag the from the same place, the old text disappaers and the new one shows up, in the new position where i've dropped the object.
is the problem here?
thanks!
Another thing. i'm just storing what i draw in a list of CPoint's. Is it posible to transfer the text to points? sounds quite hard to me.
should i put everything in a CRgn?
|
|
|
|
|
kfaday,
It seems to be me answering you all the time
You don't say what the problem is, is the text not moved? Is it moved to the wrong place? Is it not shown until you drop it (that is, don't you see it while dragging?).
If it is something wrong with the position, you can use TRACE to output values to the debug-window while running the app (it's difficult to use breakpoints for drawing operations, as they will be triggered as soon as you restart from the breakpoint...). TRACE looks like:
TRACE( "Some variables to check %i, %i\n", variable1, variable2 );
well, you might just want to check it up on MSDN
If it is the latter case, that is, you don't see it while dragging, then your problem is most likely that you don't invalidate and redraw the screen in your MouseMove -handler.
You might want to look at my articles http://www.codeproject.com/miscctrl/diagrameditor.asp[^] and http://www.codeproject.com/miscctrl/flowcharteditor.asp[^] - which are frameworks for vector drawing apps, although your application seems to be more of a freehand drawing tool.
To convert text strings to points - if I understand you correctly - yes, that is quite hard. My suggestion is that you structure your data so that it consists of different drawing objects, one being a single line segment, one being a text string etc. You can see this in the articles I mentioned.
|
|
|
|
|
thanks for the help. i solved it by creating a list of text, so everytime the window gets redrawn, every text piece gets redrawn
|
|
|
|
|
I use the follow code to change the color of status bar YourStatusBar.GetStatusBarCtrl().SetBkColor(Color);
but the right of the status bar has a little rectangle,you can see it in any window(the right bottom of the window),it keep default color,how can I change it's color or just move it from the status bar?
hiall
|
|
|
|
|
I have a function that finds the end of the lines of text in an edit field and adds more text to end of edit field.
However after all is done, everything is selected.
The MSDN says to send EM_SETSEL with -1,0 to deselect all the text, but my text is still selected.
What have you done to correct this?
If it is any issue, this code is in the OnSetActive for a property page.
Thanks.
|
|
|
|
|
To clear the selection, set the first and last values to the same value, eg. 0,0. The cursor will then be placed at position 0, with no selection.
Hope this helps,
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
The wierdness continues... That did not help.
All the text is still selected.
Maybe some messages were posted, and others were sent.
I am going to try a selection in another handler, like OnInitdialog or something.
Thanks.
I will let you know what worked.
|
|
|
|
|
Okay, all the text is selected, still, because the edit control is the first control on the page, and it has the focus
|
|
|
|
|
"There is only one shared copy of static data members for all objects of a given class type." (from MSDN Library)
My question is... Is there also only one shared copy of Normal member-functions (nonstatic and not-inlined, even nonvirtual) for all objects of a given class type?
Thing to consider (from MSDN Library):
"...Class member functions are treated differently, depending on whether they are declared as static. Because nonstatic functions have an implicit argument that supplies the this pointer, nonstatic functions are considered to have one more argument than static functions; otherwise, they are declared identically."
It seems have NO reason for not-inlined plus nonstatic member functions to be instanced multiple times.
I thought it would be usefull to understand this when we need to make an array of thousands objects of AClass. Lets assume the class itself contains some nonmodified member-functions to process the class data members. If the memory usage & overheads are similar then we don't have to make those functions complicated with static modifier, do we?
Example:
class AClass {
public:
int a;
char* b;
BOOL c;
MyClass(); -\
~MyClass(); |
... |
char* Func1(); |--> Is there any member function
BOOL Func2(int alpha); | here that better as static?
... |
int Func79(); -/
};
...
CArray<AClass,AClass> AnArray;
...
for (int i; i < AnArray.GetSize(); ++i) {
char* temp = AnArray[i].Func1();
...
}
If those functions have single instance, what if we change the keyword class into struct? Afterall the class data members are POD-Types and the compiler allows it! If we can spare some memories for faster access on this, so why not?
|
|
|
|
|
Vicord Chrane wrote:
My question is... Is there also only one shared copy of Normal member-functions (nonstatic and not-inlined, even nonvirtual) for all objects of a given class type?
Yes. There is only one instance of each member function per class. If the function is virtual, each object stores a pointer to the function, but the function itself is only defined once.
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
Can some one point me to an article that shows you how to enumerate the active internet ports, and retrieve information like the client/host ip and port number, like netstat.exe does on windows
|
|
|
|
|
I have a problem connecting to a server that I'm writing in C.
I'm working on this client program in C, but it can never connect to the server. The Server is coded in C as well, but it is in UNIX, this is for my work. Basically they want me to code the client program in Windows so they can have a windows version running, however, I can never get it to get authorization from the server. The part where it rejects me is below
Code:
// server.c
/* The client makes a simple identification */
if(fgets(line,MAXLINE,fdr) == NULL) goto finish;
/*if(sscanf(line,"%s %s %s",who,passwd,version) != 3) goto finish;*/
strcpy(interface, "stpc");
if(sscanf(line, "%s %s %s %s",who,passwd,version,interface) < 3) goto finish;
// this printf ensures that line has an interface
// for the logs
sprintf(line, "%s %s %s %s\n",who,passwd,version,interface);
if(strcmp(passwd,PASSWD) != 0) goto finish;
fprintf(stplog," %s %s %s",timestamp(),whoami,line);
fflush(stplog);
/* Let the client know we are connected */
fprintf(fdw,"CONNECTED\n");
fflush(fdw);
that was the server portion, and now below is the one I am trying to code, which is in windows.
Code:
fd_rd = _open_osfhandle(ws_sockfd, 0);
if (fd_rd == -1) exit(-1);
ws_fdr= fdopen(fd_rd,"r");
ws_fdw= fdopen(fd_rd,"w");
if( ws_fdr == NULL || ws_fdw == NULL)
err(FATAL,"STP: cannot open ws_fdw/ws_fdr\n");
/* send authorization */
printf("Sending authorization!\n");
sprintf(line,"%s %s %s %s\n","STP",PASSWD,VERSION,"stpc"); // sets line to the ip, password, version, and interface
ws_putline(line);
fflush(ws_fdw);
printf("Authorization sent, awaiting confirmation!\n");
/* get connection acknowledgement */
/*
Below is where we get our
Connection failures
*/
ws_getline(line,MAXLINE);
if(strcmp(line,"CONNECTED\n") != 0) {
err(WARN,"STP: Connection rejected by waveserver - %s\n", line);
continue;
}
Basically it's trying to send the server the info, which are the password, version, interface and STP. and then the server should verify it and then say OK, and copy "CONNECTED\n" into line, and the we should be connected. On UNIX, both the client program and Server work fine. Please help, thanks.
|
|
|
|
|
How can I find out whether MSWord, MSExcel,MS PowerPoint application is open.
I know a function that can tell me whether MSExcel is open or not. However, I dont 'know the Word and PowerPoint application name to find.
<br />
FindWindow("XLMAIN");<br />
Thank you
|
|
|
|
|
FindWindow() would not be my first choice in doing what you want. First, the caption or class of the window can change, or may not be unique, at any time. Second, sending a WM_GETTEXT message to a window whose thread may be blocked could result in deadlock.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
You could use a process viewer, or make one yourself
there is one that comes with Visual Studio 6
if you installed the tools
there are some example ones here at code project
and i recently made one for my self, that lists all open process, and allows you to terminate them, i also added a tab in it to enumerate windows, tell you whether they're hidden or visible, and allows to close/hide/show the window
|
|
|
|
|
I have a fairly complex CArray object built where problems seem to be happening.
The CArray object looks as follows
<code>
class Items
{
public:
Items(){}
Items::Items(const Items &pCopy)
{
operator= (pCopy);
}
Items& Items::operator =(const Items& Array)
{
ItemGroup = Array.ItemGroup;
ItemCategory = Array.ItemCategory;
ItemCode = Array.ItemCode;
ItemDescription = Array.ItemDescription;
ItemAmount = Array.ItemAmount;
return *this;
}
CString ItemGroup;
CString ItemCategory;
CString ItemCode;
CString ItemDescription;
int ItemAmount;
};
class StartingItems
{
public:
StartingItems(){}
StartingItems::StartingItems(const StartingItems &pCopy)
{
operator= (pCopy);
}
StartingItems& StartingItems::operator =(const StartingItems& Array)
{
for(int i=0; i<Array.m_Items.GetSize(); i++)
m_Items.Add(Array.m_Items.GetAt(i));
Era = Array.Era;
Age = Array.Age;
EraCode = Array.EraCode;
AgeCode = Array.AgeCode;
return *this;
}
CArray<Items, Items> m_Items;
CString Era;
CString Age;
CString EraCode;
CString AgeCode;
};
</code>
Then I define the following variable
CArray<StartingItems,StartingItems> m_pItemsMap;
Now when I add StartingItems objects to m_pItemsMap I can see the array growing. But when I add objects to m_pItemsMap[index].m_Items nothing happens. I've noticed that the copy constructor is getting called numerous times in the StartingItems object and when it is called there is nothing the Copy parameter is empty of any values. Kinda like putting stuff in a bag with no bottom. You can see the stuff going in but the bag is always empty.
My adding code is the following
StartingItems pSI;
pSI.Age = AgeDescription;
pSI.Era = EraDescription;
ItemIndex = m_pItemsMap.Add(pSI);
Items pI;
pI.ItemAmount = atoi(Amount);
pI.ItemCategory = ItemCategoryCode;
pI.ItemCode = ItemCode;
pI.ItemDescription = Description;
pI.ItemGroup = ItemGroupCode;
pSI.m_Items.Add(pI);
pSI.Age = AgeCode;
pSI.Era = EraCode;
m_pItemsMap.SetAt(ItemIndex, pSI);
Does anyone see anything wrong? Am i using this object correctly. Obviously I must be doing something incorrectly.
Thanks!
|
|
|
|
|
brchris wrote:
I've noticed that the copy constructor is getting called numerous times in the StartingItems object and when it is called there is nothing the Copy parameter is empty of any values.
I set a breakpoint in both copy constructors. In each instance the parameter pCopy had the expected values.
Setting a breakpoint on the pSI.m_Items.Add(pI) statement, you'll see the m_Items array grow.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Thanks! From there taking the assumption it works fine I noticed an interesting problem.
<br />
m_pItemsMap.GetAt(i).m_Items.Add(Item);<br />
note: I didn't include this in the previous example which was another red flag.
This was the issue. I can't explain it very well, but if I assigned m_pItemsMap.GetAt(i) to a variable of type StartingItems then went
<br />
pSI.m_Items.Add(Item);<br />
m_pItemsMap.SetAt(Index, pSI);<br />
that fixed it. Thanks for the heads up!
|
|
|
|
|