Search Results

Showing results 1 to 40 of 47
Search took 0.01 seconds.
Search: Posts Made By: Cybulski
Forum: C++ Jun 14th, 2008
Replies: 5
Views: 1,011
Posted By Cybulski
I'm quite sure he asked how to test keypress in while but I have no idea how to do it while( now)
Forum: C++ Jun 14th, 2008
Replies: 17
Views: 1,610
Posted By Cybulski
When I make vector static, I get unresolved external error.

In meantime I found this:
http://homepages.tesco.net/J.deBoynePollard/FGA/class-function-members-cannot-be-thread-functions.html

Do...
Forum: C++ Jun 13th, 2008
Replies: 17
Views: 1,610
Posted By Cybulski
Ok, it seems I must still learn a lot about windows threading.

I have these threads running, but I need them to use base class method and container. Base to MultiReader (DirectoryReader) have...
Forum: C++ Jun 13th, 2008
Replies: 17
Views: 1,610
Posted By Cybulski
Wow... Thanks for this tip.

I still think of these object in POSIX manner, where (as far as I remember) wait functions do not return untill they acquire semaphore, if timeout was set to infinite....
Forum: C++ Jun 13th, 2008
Replies: 17
Views: 1,610
Posted By Cybulski
I replaced that Mutex with Semaphore object. There should be no much difference, but anyway, this is pretty much my code now:

// MultiReader.h
class MultiReader :
public DirectoryReader
{...
Forum: C++ Jun 13th, 2008
Replies: 2
Views: 387
Posted By Cybulski
If you using C++ (you are posting in C++ forum) you should take advantage of STL library which is part of language now. You should almost always use STL containers and avoid C-style arrays.
Forum: C++ Jun 13th, 2008
Replies: 7
Views: 2,930
Posted By Cybulski
Everything ok with this function now, I mark this thread as solved and continue being problematic in this thread:
http://www.daniweb.com/forums/thread127041.html
Forum: C++ Jun 12th, 2008
Replies: 17
Views: 1,610
Posted By Cybulski
Ok I figured out that static const must be initialize within class body, but still:

class MultiReader :
public DirectoryReader
{
public:
MultiReader(char* p_sConfigPath);...
Forum: C++ Jun 12th, 2008
Replies: 7
Views: 2,930
Posted By Cybulski
I managed to make compiler accept parameter using &vDirectories.at(nThreadNo) but I missed that litte (void*). Thank you very much, good sir!

Threading almost solved for me.
Forum: C++ Jun 12th, 2008
Replies: 7
Views: 2,930
Posted By Cybulski
Now I need to do something like this:

CreateThread( NULL, 0, &MultiReader::ReaderThread, (void*)vDirectories.at(nThreadNo), 0, NULL);


While vDirectories is:

struct OPTIONS
{
string...
Forum: C++ Jun 12th, 2008
Replies: 17
Views: 1,610
Posted By Cybulski
Ok, I got working threads, but still can't make proper synchronization. It's hard to find good example.

So, there is header file:

class MultiReader :
public DirectoryReader
{
public:...
Forum: C++ Jun 12th, 2008
Replies: 7
Views: 2,930
Posted By Cybulski
Yep, that's it. I tried to figure it out for days. & was there just because compiler suggested me to put it there. That thing is solved, thank you very much.

Now parameter 4: it should be &adress...
Forum: C++ Jun 12th, 2008
Replies: 7
Views: 2,930
Posted By Cybulski
I'm trying to call this function requested times. All functions and variables are members of one class, access is public. So, I'm calling like this:

void MultiReader::CreateThreads()
{
unsigned...
Forum: C++ Jun 7th, 2008
Replies: 19
Views: 1,210
Posted By Cybulski
Just one tip: you don't need clock(). You counting virtual time, so you can represent this as integer. It's easier to add and calculate average queue time that way.

Opps sorry Salem already wrote...
Forum: C++ Jun 7th, 2008
Replies: 8
Views: 1,647
Posted By Cybulski
#include <cctype> // for toupper()
#include <algorithm> // for transform()

transform(x.begin(), x.end(), x.begin(), toupper);


try this
Forum: C++ Jun 5th, 2008
Replies: 17
Views: 1,610
Posted By Cybulski
Yeah sorry I missed point. I'm still thinking about semaptores in POSIX manner - acquired means it's acquired regardless of process accessing it.
Forum: C++ Jun 5th, 2008
Replies: 17
Views: 1,610
Posted By Cybulski
I am still stuck with this... It seems bit complicated to fill security attributes and security descriptor structures. Anyone have experience with this? Option is to use MFC, but I'm not familiar...
Forum: C++ Jun 1st, 2008
Replies: 17
Views: 1,610
Posted By Cybulski
I'm pretty sure semaphore is not working correctly anyway. There should be no difference between single thread and more threads acquiring semaphore. For example, if I call WaitForSingleObject() twice...
Forum: C++ May 31st, 2008
Replies: 4
Views: 1,042
Posted By Cybulski
How about casting
int* a = (int*)x;?
Forum: C++ May 31st, 2008
Replies: 3
Views: 695
Posted By Cybulski
http://www.google.com/search?hl=pl&q=generating+random+numbers+c%2B%2B&lr=

First result for me is ling to DaniWeb article on generating random numbers.
Forum: C++ May 31st, 2008
Replies: 17
Views: 1,610
Posted By Cybulski
I'm trying to implement critical section using objects listed in this article: http://www.mycplus.com/tutorial.asp?TID=290

Somehow, it doesn't work like intended, or maybe I do something wrong....
Forum: C++ May 28th, 2008
Replies: 6
Views: 1,022
Posted By Cybulski
All I can tell on this subject is: compilator do not detect problems or errors with directx, only withyour C++ syntax.
Try get Dev C++ help on that error. Errors often are indicated at end of file,...
Forum: C++ May 28th, 2008
Replies: 14
Views: 1,000
Posted By Cybulski
Yeah if you can't understand how to use simple bbcode, where is point od teaching you C++? You should try just a bit making people think on what you posted. My brain threw "Confused by earlier...
Forum: C++ May 27th, 2008
Replies: 2
Views: 364
Posted By Cybulski
I want recursively fill members of one structure, it looks like this:

struct OPTIONS{
string sDirectoryName;
vector<string> vExtensions;
int uOperationId;
} structCurrentDir;


after...
Forum: C++ May 22nd, 2008
Replies: 1
Views: 534
Posted By Cybulski
I'm trying to pass string as filename. I wonder if there is some smart function checking every character of string if it's alphanumeric, or belongs to group of few other character specified?
Loop on...
Forum: Network Security May 21st, 2008
Replies: 6
Views: 2,937
Posted By Cybulski
How is this possible technically? Every single mail server will archive emails and IMs..?
Forum: C++ May 21st, 2008
Replies: 4
Solved: Delete Folder
Views: 768
Posted By Cybulski
It lists files, you still need recursively delete directories beginning with deepest path. This calss will be more complex, handling configuration file and multitasking.

DirectoryReader.h:
...
Forum: C++ May 21st, 2008
Replies: 4
Solved: Delete Folder
Views: 768
Posted By Cybulski
You need to empty this folder I guess. That's how Windows works if you noticed.

Right now I am working on file listing class, it places all files in given subdirectory in vector of strings. If you...
Forum: C++ May 21st, 2008
Replies: 6
Views: 501
Posted By Cybulski
Pretty confusing I must say... I think I will skip it for now. I don't know final shape of my solution now.
Forum: C++ May 21st, 2008
Replies: 6
Views: 501
Posted By Cybulski
What if EdRules is part of another class?
And another class is part of another? Exception catching should be performed in each of these?
Forum: C++ May 21st, 2008
Replies: 6
Views: 501
Posted By Cybulski
Can you please give simpliest example?
Forum: C++ May 21st, 2008
Replies: 6
Views: 501
Posted By Cybulski
I'm starting writing class that should read configuration file and initialize some members with data from file. I decided to read this file in constructor. What should constructor do, if something...
Forum: C++ May 20th, 2008
Replies: 11
Views: 1,104
Posted By Cybulski
WonderAbu have no idea how to ask, and you guys answer quite advanced things. All I could advise is to check out some basics and terminology in C++:...
Forum: C++ May 19th, 2008
Replies: 12
Solved: string reverse
Views: 4,723
Posted By Cybulski
This way or another, you should use iterators, to avoid exceeding string boundaries.

For example:

string str;
string::iterator iter_str = str.begin();

while(iter_str != str.end())
{...}
Forum: C++ May 18th, 2008
Replies: 12
Views: 1,173
Posted By Cybulski
If you mean _findfirsti46(), then no. It isn't counted as first result. It only returns handle for future searches. In my previous implementation "." directory was displayed.
Forum: C++ May 17th, 2008
Replies: 12
Solved: string reverse
Views: 4,723
Posted By Cybulski
I don't really want to think at the moment, but I can post you my string reversing piece of code. Safe and elegant.

#include <string>

string str="shankhs";
reverse(str.begin(), str.end());
Forum: C++ May 17th, 2008
Replies: 2
Views: 912
Posted By Cybulski
http://www.cppreference.com/cppstring/find.html

Use 1st variant in some kind of loop.
Forum: Linux Servers and Apache May 17th, 2008
Replies: 3
Views: 1,566
Posted By Cybulski
For some reason I don't want develop for Linux. It usually lacks hi-level functions and you have to use fork(), shmget(), etc. You have much more free hand writing for Windows, and there is variety...
Forum: C++ May 17th, 2008
Replies: 12
Views: 1,173
Posted By Cybulski
Nope, not working. Negating whole condition not working also. Only way to get list of files is using && operator, and my brain is melting while thinking why.
Forum: C++ May 16th, 2008
Replies: 12
Views: 1,173
Posted By Cybulski
yes, it compiles and works ok, but this:

if( (s_current.compare(struct_filedata.name) && s_parrent.compare(struct_filedata.name)) )
{
s_filename = p_sPath + "\\" + struct_filedata.name;
...
Showing results 1 to 40 of 47

 


About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC