|
Hi,
First of all I hope this is the right place for this question, if not please direct me to the appropriate place and accept my apology in advance.
I'm a beginner level programmer and have done some C and C++ in school. My work is more of a sys-admin nature so I unfortunately don't get a chance to polish my coding skills through work either.
I need to write a small windows utility to act as a dhcp server for 4-6 windows clients. This is a private type project and for some reason the requestor does not want to use any existing freeware/shareware or even the windows built-in dhcp server. The scenario is a setup of 4-6 windows machines, one of which would be running this utility to act as a dhcp server. As far as I understand, all machines are running win xp.
As I mentioned above, I'm just a beginner level so this may be out of my scope and I understand that but that is EXACTLY the reason why I want to do this. I have a few weeks so I'm hoping that should be enough time to learn and understand. I think this may be a very good opportunity for me to better my coding skills since its a real project and not book exercises. I have read up on dhcp in the last couple of days and now atleast understand what it is and what it does.
Can someone please guide me on this, so I can atleast have an idea of what I need to learn/understand and where to start. Also, since its code, I'm assuming it could be done a variety of different ways, so if there are multiple suggestions, all are welcome...
Thanks very much...
uzee
|
|
|
|
|
|
Hi every body,
Can somebody please send me a link to learn threads and how to implement it .
Thanks
|
|
|
|
|
Here^
<marquee scrollamount="1" scrolldelay="1" direction="up" height="10" step="1">--[ ]--
[My Current Status]
Link2006 wrote:Let's take it outside of CP
Jeremy : Please don't.I would love to see this.I'm making the popcorn already.
|
|
|
|
|
|
WhiteSky wrote: See Using Worker Threads
both link by Mr. joseph he he he
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief And you
|
|
|
|
|
One of the things that I have been working on for the past couple of days is creating a DLL in VC++ 6.0 and using it in VC#, and it works..... but when I create the dll in VC++ Visual Studio 2005, it doesnt work with the VC# code.(in Visual Studio 2005)...... I get the error message that it could not find the fntest () function in TestDll.dll.
Let me be more specific about how I created the DLL.....( and I followed the same steps for VC++ 6.0 and VC++ 2005).
After following the steps in the link http://www.icynorth.com/development/createdlltutorial.html(I created a project that exports some symbols instead of a simple dll)I created a .def file, specified the test function as EXPORT. Then I went to build->configuration manager. and changed the configuration from debug to release. I then built the project, got the dll and copied it to the folder C:\WINDOWS\system32.
Then I used PInvoke in VC# code and it worked fine for a VC++ 6.0 dll but not for a Visual Studio 2005 dll in VC++. I have a code ( written by someone else) in Visual Studio 2005. It has a lot of libs etc. specific to .NET, so I have to convert this code to a dll and then use it in my VC# program.
I am desperately waiting for a response.
Thanks,
|
|
|
|
|
If you update your VC6 project to 2005, does it still work ?
saania khan wrote: I have a code ( written by someone else) in Visual Studio 2005. It has a lot of libs etc. specific to .NET, so I have to convert this code to a dll and then use it in my VC# program.
If it's specific to .NET then it's managed code, which means you should be building a managed dll ( in fact, you have to ) and you won't p/invoke that, you'll just import it.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
How To Get All of Desktop Pixel And Copy to one variable
!=Hight Speed
|
|
|
|
|
This would be better^
-- modified at 5:36 Sunday 24th September, 2006
<marquee scrollamount="1" scrolldelay="1" direction="up" height="10" step="1">--[ ]--
[My Current Status]
Link2006 wrote:Let's take it outside of CP
Jeremy : Please don't.I would love to see this.I'm making the popcorn already.
|
|
|
|
|
Get HDC of desktop win then use GetBitmapBits .
|
|
|
|
|
Hi all,
I want to enumerate files in a folder that has a large amount of files, I use FindFirstFile and FindNextFile but they seem to be slow, furthermore, they extract file attibutes for all files/folders they enumerate...
Anybody has an idea on how to boost performance? or are there othe file enumeration functions I should use??
Plz help
Mohammad
And ever has it been that love knows not its own depth until the hour of separation
|
|
|
|
|
FindFirstFileEx allows you to use these options:
typedef enum _FINDEX_SEARCH_OPS
{
FindExSearchNameMatch,
FindExSearchLimitToDirectories,
FindExSearchLimitToDevices
} FINDEX_SEARCH_OPS; MSDN docs also state that these options are advisory only, meaning that the function could ignore it. Your mileage may vary.
Requirements
Client: Requires Windows XP, Windows 2000 Professional, or Windows NT Workstation 4.0.
Server: Requires Windows Server 2003, Windows 2000 Server, or Windows NT Server 4.0.
Header: Declared in Winbase.h; include Windows.h.
--
Simulcast on Crazy People's Fillings
|
|
|
|
|
Unfortunately, I am targeting windows mobile devices... so, it wont work
Thanks alot
And ever has it been that love knows not its own depth until the hour of separation
|
|
|
|
|
Bummer.
--
Hey, TiVo! Suggest this!
|
|
|
|
|
<br />
while ((ch = getchar()) !=EOF && isdigit(ch)){<br />
result = result *10 + ch - '0';<br />
}<br />
printf("number is %d\n", result);<br />
i wonder what is '0' means. Is it is null character?
~~~@@@###EZRA###@@@~~~
|
|
|
|
|
EzraYap wrote: result = result *10 + ch - '0';
actually it's not null.. actually it is ascii based calculation.. i.e. '0' ascii value is 41 , '1' will 42 and so on.. so it way of extracting number from char character ... thats logic here
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief And you
|
|
|
|
|
Thanks. i undestand now.
~~~@@@###EZRA###@@@~~~
|
|
|
|
|
ThatsAlok wrote: thats logic here
The only logical thing to say would be arithmetic
--
Presented in doublevision (where drunk)
|
|
|
|
|
Jörgen Sigvardsson wrote:
The only logical thing to say would be arithmetic
he he he
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief And you
|
|
|
|
|
Hi All.
I start to learn multiThread and i wrote some simple program.
I dont know why i crash - i try to look into by using debug and i dont see nothing wrong.
IF someone can tell me what i doing in wrong way .... ?
Thanks for any help.
Here the code :
<br />
...<br />
...<br />
<br />
using namespace std;<br />
<br />
CRITICAL_SECTION sc;<br />
<br />
void __stdcall func(LPVOID param)<br />
{<br />
char szBuffer[256];<br />
{<br />
EnterCriticalSection(&sc);<br />
long lVal = *((long*)param);<br />
<br />
<br />
while(lVal > 0)<br />
{<br />
sprintf(szBuffer, "lVal is : %ld \n", lVal--);<br />
printf(szBuffer);<br />
}<br />
LeaveCriticalSection(&sc);<br />
}<br />
}<br />
<br />
<br />
void main(void)<br />
{<br />
HANDLE thread1,thread2;<br />
<br />
long lVal = 10;<br />
<br />
thread1 = CreateThread(NULL,<br />
5,<br />
(LPTHREAD_START_ROUTINE)func,<br />
&lVal,<br />
CREATE_SUSPENDED,<br />
NULL);<br />
<br />
SetThreadPriority(thread1, THREAD_PRIORITY_HIGHEST);<br />
<br />
lVal = 1000;<br />
<br />
thread2 = CreateThread(NULL,<br />
5,<br />
(LPTHREAD_START_ROUTINE)func,<br />
&lVal,<br />
CREATE_SUSPENDED,<br />
NULL);<br />
<br />
SetThreadPriority(thread2, THREAD_PRIORITY_HIGHEST);<br />
<br />
ResumeThread(thread2);<br />
ResumeThread(thread1);<br />
<br />
WaitForSingleObject(thread2, INFINITE);<br />
WaitForSingleObject(thread1, INFINITE);<br />
}<br />
|
|
|
|
|
maybe you have a deadlock, plz check ur algorithm before u check ur code..
And ever has it been that love knows not its own depth until the hour of separation
|
|
|
|
|
I don't have deadlock. and the algorithm is fine.
In case deadlock the application will not crash -
If i init the critical section ( in first line of the main i do InitializeCriticalSection(&sc); ) then i avoid the crash but i still see that the second thread get into the critical area even that the first thread is in it.
What wrong in the code ?
|
|
|
|
|
I realy need some help here.
|
|
|
|
|
It seems your problem is EnterCriticalSection
|
|
|
|