|
Hi All,
Is there anyway to make the "Send" call of CSocket in sycrhronous way?
-Sarath
Currently I am working as software engineer at Network System Technologies Pvt. Ltd (NeST). Most of my project are in C++. Most interesting are is GUI programming.
|
|
|
|
|
need a expert to help,how to set images onto outlookbar's folder?
how to use setfolderimagelist(...)?
|
|
|
|
|
Hallo
Assume I have some classes...
One class for communication and their derived for the exteranl machine that is used. There for class DEVICE provides some virtual functions and some normal member function...
Now i want to write some libraries ( *.dll ) and they should also use the class DEVICE... but only the nonchangeable methods write and read. So i'd like to pass two function pointers the dll -- no problems so far...
But how about creating the function pointer...
I retrieve: cannot convert from 'void (__cdecl CDEVICE::*)(int,char *)' to 'void (__thiscall CDEVICE::*)(int,char *)' or other proplems i cant fix ...
this is what i have:
<br />
class CDEVICE<br />
{<br />
public:<br />
typedef void (CDEVICE::*sendfunc)(int,char*);<br />
sendfunc sendout;<br />
<br />
void _cdecl dev_out (int p_adr,char* devcmd);<br />
};<br />
...
<br />
CDEVICE::CDEVICE()<br />
{<br />
sendfunc = dev_out;<br />
}<br />
Please Help
THX T
|
|
|
|
|
short answer: you can't use pointers to non-static member functions without an instance of the object.
long answer: search CP for "member function pointer". there are a lot of articles with tricks to make doing that easier.
Cleek | Image Toolkits | Thumbnail maker
|
|
|
|
|
Is there any way to define a shortcut to a class memeber?
For instance, a reference to System::Windows::Forms named WinForms or something.
I tried #define but I get a compiler crash in VC2005 Express Edition.
|
|
|
|
|
did you tried with typedef keyword ?
typedef System::Windows::Forms WinForms;
otherwise, you could use the using directive, but it's not recommended to.
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
Hi to all. My name is Zoli and i'm in trouble in reading from a file at a given offset.
More exactly what can i do if - let's say - i calculate from the RVA of an exe's section
the fileoffset and i want to read the entire (or some bytes)
section to display in text format.
Or how can i read some bytes from an exe at given fileoffset
(fileoffset that was calculated from an RVA).
I hope i made my problem to be clear for you!
Any suggestion is apreciated! (Sorry for my horrible english). Thanx!
|
|
|
|
|
Hello. You can try this (read 12 bytes starting with offset 895) :
<br />
HANDLE fp;<br />
DWORD count;<br />
unsigned char buffer[12];<br />
fp = CreateFile ("File.name",GENERIC_READ,FILE_SHARE_READ,NULL,OPEN_ALWAYS,0,NULL);<br />
SetFilePointer(fp,895,NULL,FILE_BEGIN);<br />
ReadFile(fp, buffer, 12, &count, NULL);
CloseFile(fp);<br />
If you decide to use fopen, make sure you open the file in binary mode ("rb").
Kakan
|
|
|
|
|
I use CreateFile().
Yhank you very much!!
|
|
|
|
|
Your welcome.
But I missed a couple of (minor) details:
1.
The argument OPEN_ALWAYS should of course be OPEN_EXISTING.
2.
The comment "// Read the sector, 512 bytes", should have been
"// Read 12 bytes "
The eternal "cut and paste" syndrom.
Kakan.
BTW, you know you can give points to a response that helped you with your problem?
|
|
|
|
|
I'm curious what was wrong with the CreateFile() suggested here.
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|
|
it was good. I was curious what answer would give other peoples.
|
|
|
|
|
who knows the most simple way to append a menu with a icon?
for my application I only have 3 menu items need a icon attached as extra data.
a string attached would be much better, but not a must.
thank you
|
|
|
|
|
Please help me...
Is there anyone know how to take this kind of program into practice in general:it is been started just after booting,for the user who is not the administrator.And when the program is running,the user can only do things that the program permit and can't do anything that the program doesn't permit,including exiting and returning to the operating system.If wants to do so , a password is needed.Whithout the pass word,exiting is the same thing as shutting the computer down.
Thank you!
|
|
|
|
|
luyongxing wrote: Is there anyone know how to take this kind of program into practice in general
Yes, most of the people in this forum can help you but what is exactly what you want?
Marc Soleda.
... she said you are the perfect stranger she said baby let's keep it like this... Dire Straits
|
|
|
|
|
Maybe I did not say clearly and even there were some grammar mistakes.I am very sorry for that.I will think it over and explain it in exact words.
|
|
|
|
|
One way would be to replace the shell with one of your own. I did this once with Windows 9x. The registry value is:
HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Winlogon\Shell
By default, the shell is explorer.exe. There are many articles on the Net that can provide you with details.
Another way is via the Group Policy Editor.
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|
|
I create a new project (MFC Dialog) and place a button on the dialog. The code that the button performs is the following:
<br />
CCriticalSection c;<br />
c.Lock();<br />
c.Lock();<br />
c.Unlock();<br />
c.Unlock();<br />
When I start the Program in DEBUG-Mode I expect the following behaviour:
1. The CritSec is created.
2. The first Lock is applied.
3. The second call to Lock should result in a deadlock.
But that is not the case. The code will run without any problems.
WHY !!!!
Is there some different behaviour in DEBUG-Mode, or what?
Greets Snow
|
|
|
|
|
what is the return value when second lock is applied
-- modified at 6:51 Monday 28th November, 2005
|
|
|
|
|
|
Hi,
the CCriticalSection object encapsulates the CRITICAL_SECTION type.
The lock function calls the EnterCriticalSection API. So from the MSDN libs I found this:
After a thread has ownership of a critical section, it can make additional calls to
EnterCriticalSection or TryEnterCriticalSection without blocking its execution. This prevents a
thread from deadlocking itself while waiting for a critical section that it already owns. The
thread enters the critical section each time EnterCriticalSection and TryEnterCriticalSection
succeed. A thread must call LeaveCriticalSection once for each time that it entered the critical
section.
So it is normal behaviour
codito ergo sum
-- modified at 11:29 Monday 28th November, 2005
|
|
|
|
|
|
Hi all,
I have to write a program in MFC that should do:
- draw a sinusoidal signal on the screen
- draw a random signal with random dispersion on the screen
- draw the sum of the two signals
I haven't program and I'm not very interested in programming in MFC, so I'm just asking if anybody of you have done something like this and could give me a ready class, a hint, etc. If there are some ready functions in MFC I'll appreciate if you point them.
Thanks very much for the help!
SELECT * FROM LIFE
|
|
|
|
|
There are several chart articles that may help you. One that I've used in several ocasions to represent data series is XGraph[^] that is very powerfull
I hope it helps,
Marc Soleda
... she said you are the perfect stranger she said baby let's keep it like this... Dire Straits
|
|
|
|
|
I am working on something like this but
havent done up with the work and it remaining to
optimise the class.
But u can find some example in codeproject for
displaying some good sinosuidal signals.
Abuout random i dont knwo if the same class can do
the work for but will try my class to do that for u
Vikas Amin
Embin Technology
Bombay
vikas.amin@embin.com
|
|
|
|