|
It appears that I have one more trouble.
My code is unable to link with this srv_paraminfo function. when I go through srv.h and its various codes, this function is not there either.
Is there a versioning issue here?
|
|
|
|
|
New version at my website.
This should fix the resource leaks that some people have been reporting.
I'm in the middle of rewriting the help as a compiled help file so that I can reduce the size of the web page (and help everyone with a better reference document ).
When I've finished the doc.s I'll update the article here as well.
Derek Lakin.
I wish I was what I thought I was when I wished I was what I am.
Salamander Software Ltd.
|
|
|
|
|
I wrote a program that works fine under 9x, but under NT2, 2k it has font display issues.
When I refresh some on screen data, I set the text of some static windows, and it loses it's font. For instance, I'll have "some text" which I'll SetWindowText() to "some other text" and it comes out in the system font (not "arial" or the parent window's font, but "system") This doesn't happen in 9x - it retains the old font.
How can I go about getting win9x's behavior where it says the same font it was before I set it?
I've tried going back through and setting the font later, but there is noticible flicker. I'm attempting to send WM_SETFONT before changing the text, but I'm getting mixed results.
Many, many thanks in advance.
|
|
|
|
|
hi all
i need to store character strings in two-dimensional array. i have to allocate memory dynamically so can't say char array[10][10][20] if i need to reserve 10X10 matrix for strings of 20 characters each. can someon eplease tell me how to do this using pointers? thanks.
i just know that my strings will be 20 characters. i don't know the number of rows and columns, and that will be provided on runtime.
imran.
|
|
|
|
|
Well guess what... to the compiler it's just a chunk of memory. You'll have to do the math yourself. I suggest drawing a picture (a cube) and figuring out the math yourself. If you work with the linux framebuffer, it's very much the same.
If you still need help, think of what [1][0][0] means, [0][1][0] means, and [0][0][1] means. I forget wich way exactly C lays stuff out (but it is easy to find out yourself)
you'll need to malloc(xdim*ydim*length)
It's the same as a 2 dimentional array, but with one more dimention (the word length)
You can also imagine a long text string. Every 20 chars is a start of a new word. every y of them is a new x row.
I hope that helps.
Oh I almost forgot. You'll calculate something called and offset, then you can do
chunk=malloc(x*y*l);
offset=// left as an excersize for the reader
chunk+offset= (address of a particular character, could be the start of a word too)
*(chunk+offset) = (the character)
printf("%c", *(chunk+offset); //char
or
printf("%s", chunk+offset); // word
|
|
|
|
|
I'll tell you how to do it using STL and the C++ standard library. Much easier than pointers.
#include <vector>
#include <string>
using namespace std;
int main(int argc, char* argv[])
{
// create the matrix
const int MAX = 100;
typedef vector<string> StrVec;
vector<StrVec> vv(MAX);
int i, j;
for (i=0; i<MAX; i++)
{
StrVec v(MAX);
vv[i] = v;
}
// store "Foo" in all strings of the matrix
for (i=0; i<MAX; i++)
for (j=0; j<MAX; j++)
vv[i][j] = "Foo";
return 0;
}
CodeGuy
The WTL newsgroup: over 1100 members! Be a part of it. http://groups.yahoo.com/group/wtl
|
|
|
|
|
I was wondering if any knew what these programs that adjust windows to be faster on the net do to your system.
I believe they change registry settings, but I would like to know which ones, can anyone out there help me?
==================================================
When Your Mind Wonders...Where Does It Go???
|
|
|
|
|
Basically they try to tune a TCP parameter called MTU (Maximum Transmission Unit), which has a significant impact on performance under low bandwith conditions. This parameter is stored somewhere in the registry (depends on the platform).
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Do you by any chance have any idea what the registry key or value may be called, i tried searching for mtu and didnt get anything.
==================================================
When Your Mind Wonders...Where Does It Go???
|
|
|
|
|
There are a lot of new controls in .Net (like LinkLable,CheckListBox or Panel and ...)
Can I use these controls in VC.Net?
How?
Thanks
Mazy
You can find a solution (even a foolish one) for all problems (even big ones)
|
|
|
|
|
If you can get at System.Winforms.* then I dont see why not...
// Rock
|
|
|
|
|
But How can I get that namespace in VC++?IWhich file should I include or which library should I import?
|
|
|
|
|
I declare in my class the constructor ( and just before the empty constructor ) : Stock (char[] name , char[] mark , char[] ticker , int
value , int
curPrice , char[] company , int shares);
and when I compile I get the error :
E:\cs2413\Project1\Market.cpp(16) : error C2629: unexpected 'class
Stock ('
E:\cs2413\Project1\Market.cpp(16) : error C2238: unexpected token(s)
preceding ';'
any idea ?
Pierre Paumier
|
|
|
|
|
This is probably triggered by some syntax error some lines before Market.cpp(16) . Could you post some more code (say from the beginning of the file)?
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
this is all the code from the beginning of the class :
#include<iostream.h>
#include<string.h>
class Stock
{
private:
char nameCompany [10];
char market [10];
char tickerSymbol[10];
int stockValue;
int currentStockPrice;
char manufacturingCompany[2];
static int outstandingShares;
public:
Stock ();
Stock (char[] name , char[] mark , char[] ticker , int value , int curPrice , char[] company , int shares);
void display();
};
Stock::Stock() // empty constructor
{
}
Stock::Stock (char[] name, char[] mark , char[] ticker , int value , int curPrice , char[] company , int shares)
{
strcpy(nameCompany , name);//copy the array name to the array nameCompany
strcpy(market , mark);
strcpy(tickerSymbol , ticker);
stockValue = value;
currentStockPrice = curPrice;
strcpy(manufactringCompany , company);
outstandingShares = shares;
}
int Stock:: outstandingShares = 0;
/*display method*/
void Stock:: display()
{
int i = 0;
for( i ; i<10/*nameCompany.size*/ ; i++)
cout<
|
|
|
|
|
I got it! One of those syntax errors one can stare for hours whitout noticing: [] s are in the wrong place, it should be
Stock (char name[], char mark[] , char ticker[] , int value , int curPrice , char company[] , int shares); Regards.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Hi.
I have used Linux in the past including Red Hat and Debian. I like Debian better because of its huge library of software packages. Red Hat was faster to install and get working, but I had difficulty compiling and updating new builds of kernel.
Anyways, I enjoy programming using C++. That is all I want to do if possible.
What is the best/prefer Linux distribution for developers (C++)?
What is the best/prefer X (Gnome, KDE, etc.) for developers (C++)? My college uses Red Hat + KDE.
Thanks,
Kuphryn
|
|
|
|
|
This is a *windows* programming board. I doubt you'll get many (if any) replies other than this one.
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
There are those of us that need to do Windows for work, but enjoy Free software outside of the work place.
I think we'll all be doing KDE one day, probably in about 5-10 years. There are several things that areleady heppening that are mapping this out: From Microsoft: .Net will fail like the XFL, MS licensing will become too expensive, restrictive and intrusive. I'm not even going to touch the settlement, cause that's so up in the air. Meanwhile Linux penetrates thanks to: IBM, Compaq, and HP, will pushing Linux (even more so then than now)(And enhancing it at the same time.) Much like the PC hardware of the 80's it will filter down from big servers to the work desktops to the home desktops. Once Linux is out in enough places, developers (that's you) will catch on to the idea that I can develop and app and write it once, then just compile it for each architecture you want to shio on and whalla, you're market isn't just x86 linux boxes, but PPC (incuding and not including Macs) Suns, DEC Alphas, SGIs, etc. -- All with 1 hour of porting, per port. (I'm including time to set up the cross compiler). /* I don't know why MS doesn't drop Windows and go with Linux. OS is not a very big chunk of revenue for them, meanwhile if they went linux, they could support all the architectures above and have the huge market - and wouldn't have to worry about Mac office being seprate from PC Office */
As you can tell I'm a Linux advocate. What you probably don't know is that I do embedded systems, and Linux is great for this, much better than Winders. In Windows, are you targeting XP embedded or CE? CE is nothing but a buch of headaches to program for. Just look at the docs. The exception to the rule is always CE. With Linux, it's the same at the device, PC or mainframe level. Couple that with Java VMs that are ~100k bytes, and you have a system that can run on alot more CPUs and arch's than Windows ever could.
Anyway, I gotta get back to work.
|
|
|
|
|
KDE - Been there, done that, moved on. Runs like Windows 2.0 (yes, I actually used Windows 2.0).
People always talk about how great the Linux applications are. I have tried them. They just don't stack up.
Tim Smith
Descartes Systems Sciences, Inc.
|
|
|
|
|
What do you mean?
True, it takes forever to start an app. This is due to the fact that everything is a class and has to be dynamically linked, relocated, etc. v3.0 (which should be out shortly, (it's already in beta)) should fix this issue.
I'd like to know what Windows 2.0 was like, and what about KDE made you think of it as Win2.0.
|
|
|
|
|
SLOOOOOOOOOOOOOOOOOOOOOW (and that is on a dual 1ghz system).
Now what is this about classes having to be dynamically linked etc? Did the linux compilers do something really stupid and add extra overhead to C++ classes? C++ and C bindings should use the same mechanism with just slight variances in calling standards.
Tim Smith
Descartes Systems Sciences, Inc.
|
|
|
|
|
Well, KDE apps are classes to the core, as a result there is a lot to link up - a lot more than in a C app. The standard linker does and excelent job of what it's supposed to do, but it's not optimized for this everything-has-to-be-dynamically-linked situation.
I'll refer you to: http://www.suse.de/~bastian/Export/linking.txt -- that will explain it a whole lot better than I can. The immediate hack for 2.2 is to get apps that are mostly pre-linked.
I forget what's going on with 3.0 to fix this, but it is a issue being fixed for the next version.
I'm looking forward to evaluating 3.0 before I declare any real architecture issues.
|
|
|
|
|
Hmm, I wonder why this isn't a problem on Windows, or at least why nobody really bitches about it.
I totally forgot about the vtables which is why I didn't see why C++ would be slower. But of course, if the image is not based (or fixed), then the vtables would have to all be patched. Maybe that is why it isn't a big problem on Windows, many images are based.
Thanks for the info
Tim Smith
Descartes Systems Sciences, Inc.
|
|
|
|
|
I believe this to be because Windows is C based. True there are C wrappers (MFC) and such that just wrap the C libraries. As a result, there is a whole lot less low-level linking. (You're looking at 2-3 layers instead of about 7-9, IIRC and very small and few vtables.) Linux (KDE) developers, need not just to be correct, but poetic too, so everything is a class. This unfortuneately results in a lot of linking.
Well, partly answers your question. The other answer is because of "Quick Launch" apps. (Which has also been proposed for KDE) These apps clutter your bar, add time to your boot sequence, and pre-load the libraries for the application. So Windows isn't quite as fast as it seems either
|
|
|
|
|