|
I can't help you.
But which Packet driver do you use, i have a similar project, but not with TCP.
Marco
|
|
|
|
|
I do not use any Packet driver.
I have captured the packet using Windows 2000 Network Monitor.
And I need to calculate checksums in my driver, which is NDIS intermediate driver.
|
|
|
|
|
It may not be the problem, but you should be suspicous of any cross platform code using bitfields to pick out bits like this. The C standard does not define whether bitfields are allocated starting from the most or least significant bits of the variable. Different compilers may interpret this code differently!
<br />
UCHAR HeaderLength :4;
Some compilers will use the high nibble, others the lower nibble. Its much safer to use masks and shifts:
Either
HeaderLength = (uchar_var & 0xF0) >> 4
or
HeaderLength = (uchar_var & 0x0F)
as appropriate.
Stephen C. Steel
Kerr Vayne Systems Ltd.
|
|
|
|
|
Hi,
i believe that i have a problem to create a instance of the following object.
Declaration :
CArray <CEndPointGroup*,CEndPointGroup*> m_arEndPointGroups;
Add Pointer :
CEndPointGroup* _pEndPointGroup = NULL;
_pEndPointGroup = new CEndPointGroup(_groupname);
m_arEndPointGroups.Add(_pEndPointGroup);
At the last line i get an error. It seems that the arEndPointGroups-object is wrong allocated. What do i wrong ?
Marco
|
|
|
|
|
What kind of error it is? Compiler error? Assert at runtime? Hardware error?
Tomasz Sowinski -- http://www.shooltz.com
Free your mind and your ass will follow.
|
|
|
|
|
It's an assert error at runtime. Pointer Access Error !
i've tried only to make an array of CEndPointsGroup-Pointer.
Marco
|
|
|
|
|
Have a look at call stack. Where (file/line) is ASSERT located?
Tomasz Sowinski -- http://www.shooltz.com
Free your mind and your ass will follow.
|
|
|
|
|
Do you have looked at CPtrArray? Maybe that helps.
BTW CArray is deprecated, nonstandard and broken. You are better off using a
std::vector<CEndPointGroup*>
or even a
std::vector<boost::shared_ptr<CEndPointGroup>>
Just remember to never use std::auto_ptr in a std:: container.
|
|
|
|
|
jhwurmbach wrote:
BTW CArray is deprecated, nonstandard and broken
Nonstandard, yes. But I'd appreciate if you'd explain 'broken' and 'deprecated' part.
Tomasz Sowinski -- http://www.shooltz.com
Free your mind and your ass will follow.
|
|
|
|
|
|
Hi,
i believe that i have a problem to create a instance of the following object.
Declaration :
CArray <cendpointgroup*,cendpointgroup*> m_arEndPointGroups;
Add Pointer :
CEndPointGroup* _pEndPointGroup = NULL;
_pEndPointGroup = new CEndPointGroup(_groupname);
m_arEndPointGroups.Add(_pEndPointGroup);
At the last line i get an error. It seems that the arEndPointGroups-object is wrong allocated. What do i wrong ?
Marco
|
|
|
|
|
Maybe error in declaration of m_arEndPointsGroup?
CArray is class template
try CArray<cendpointgroup*, cendpointgroup*=""> m_arEndPointsGroup
nobody is perfect
|
|
|
|
|
Have u ever worked with CArray ?
Marco
|
|
|
|
|
I'm losing all my hair on this one.
In my app, I create a CPrintDialog like this:
CPrintDialog dlg(FALSE);<br />
dlg.DoModal();
which is very basic stuff. Running this, the dialog appears. When I select the printer properties, the app closes itself without a message! So I created a new app with the MFC wizard. In this app, I've put the same code. And guess what: no problems at all. The printer properties are shown without a problem.
To make things worse, I only have this problem in NT SP6. No problem in W2K. Haven't tested this on other windows versions...
In debugging, I get an assertion.
Pressing retry on the assertion:
call stack:
AfxWndProc(HWND__ * 0x0012e870, unsigned int 1240072, unsigned int 1239180, long 1239124) line 365 + 25 bytes<br />
AfxWndProcBase(HWND__ * 0x0012e870, unsigned int 1240072, unsigned int 1239180, long 1239124) line 220 + 21 bytes
function:
<br />
LRESULT CALLBACK<br />
AfxWndProc(HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lParam)<br />
{<br />
if (nMsg == WM_QUERYAFXWNDPROC)<br />
return 1;<br />
<br />
CWnd* pWnd = CWnd::FromHandlePermanent(hWnd);<br />
ASSERT(pWnd != NULL);
return AfxCallWndProc(pWnd, hWnd, nMsg, wParam, lParam);<br />
}
Any ideas? I'm thinking of some conflicting resources...
New and improved: kwakkelflap.com
|
|
|
|
|
Hi Everyone,
I'm currently embarking on the most exciting, but complex project I've ever attempted. The program is an advanced parametric image generator. In the last version of the program I had a wonderful engine in place, but in the end it got rather tripped by its own complexity, and the overhead involved. So now in this second generation of the program I want to implement a dynamic recompilation engine.
Atm my plugins spit out a whole load of C++ code into a buffer which is then saved, and I'm using the MSVC compiler to compile the code into a dll, which I can then call to perform my image making work. The problem is that any possible speed increases are kind of lost in the time taken to build the dll, and in the wasted cycles from C++'s inherant slowness problems. Also the microsoft license specifically states that bundling their compiler with your product is illegal - I'm not so worried about this because its only a homebrew thing. (Btw I'm only using C++ because I need to comunicate with my C++ objects, I would prefer C in this case of coarse). But the whole system is a little messy.
I would prefer a lighter language such, but it must capable of interfacing with a MSC++ DLL, be reasonably easy to learn, compiling quickly, produce reasonably quick code, and preferably be open source (so I can mod it so that it spits out function ptrs rather than files). I know this is a tall order, and I'm asking if any of you know at all. Am I going about it the right way? would you suggest that I make my own scripting language which cuts and pastes blocks of asembler together? Maybe if anyone has experience in this type of thing...
Any help is much appreciated...
With time we live, with money we spend!
Joel Holdsworth.
|
|
|
|
|
Joel Holdsworth wrote:
in the wasted cycles from C++'s inherant slowness problems
LOL
Are you programming in assembler or just entering binary codes?
You can consider GCC - I think that C++ objects could be made compatible, as long as you don't use multiple inheritance.
Tomasz Sowinski -- http://www.shooltz.com
Free your mind and your ass will follow.
|
|
|
|
|
Isn't GCC only for UNIX? Or is there some way of getting it run well with windows? Does it work with XP?
With time we live, with money we spend!
Joel Holdsworth.
|
|
|
|
|
|
hi
I'm new to C++ and would like to know how to load a file into a buffer. Is it something like
char *buf1 = fopen(??);
though that does not seem to work
thanks
|
|
|
|
|
FILE * pf;
pf = fopen("C:\\File\\Path\\File.extension" , "R" );
if (pf) { // File well opened
// in order to read work on the fread function
}
if u want to use MFC see the CStdioFile or CFile class
Papa
Murex Co.
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
tx for the reply.
pf (file in my case) unfortunately does change, but to 0, so the if function isn't entered. The file does exist, cuase I'm using the following code:
FILE *file;
CFileDialog cf(TRUE);
//Get Filename
if (cf.DoModal() == IDOK)
{
CString m_pathname1 = cf.GetPathName();
file=fopen(m_pathname1,"R");
}
if (file)
{
//does not enter here!!
}
what am I doing wrong?
|
|
|
|
|
tx for the reply
pf (file in my case) unfortunately does change, but to 0, so the if function isn't entered. The file does exist, cuase I'm using the following code:
FILE *file;
CFileDialog cf(TRUE);
//Get Filename
if (cf.DoModal() == IDOK)
{
CString m_pathname1 = cf.GetPathName();
file=fopen(m_pathname1,"R");
}
if (file)
{
//does not enter here!!
}
what am I doing wrong?
|
|
|
|
|
file=fopen(m_pathname1,"r");
with a lowercase 'r'
"640K ought to be enough for anybody."
Bill Gates
|
|
|
|
|
I like to right align tree control. If you know any idea then please tell me. Actually i want to print tree items in Arabic and for this purpose i needed to change the alignment of tree control items. If you know any such sample application or method then please tell me.
|
|
|
|
|