|
what if you change the pipe mode to MESSAGE ? That way, each read and write happens as a unit, and you don't have to read specific numbers of bytes.
--------------------------------
"All that is necessary for the forces of evil to win in the world is for enough good men to do nothing" -- Edmund Burke
|
|
|
|
|
I am using both message modes and byte modes, the reason I also use byte mode is that sometimes I need to send data to the child processes, which I don't know the size of at compile time.
I've implemented my own mechanism for splitting up the data and pushing it onto the pipe in chunks.
But the problem is when I request a buffer size for the pipe, I am unable to utilize the full buffer. In my case, there is a overhead of 24 bytes that I can't use each write operation.
I am just wondering if anyone else has experienced anything similar.
|
|
|
|
|
On Server and Client side i create an SPN like this :
DsMakeSpn("ncacn_ip_tcp","some.valid.DNS",NULL,0,NULL,&pcSpnLength,pszSpn);
On the Server i register Authentication Information with
RpcServerRegisterAuthInfo((unsigned char*)pszSpn,RPC_C_AUTHN_GSS_KERBEROS,NULL,NULL);
and a Security Callback Dummy Function that just return RPC_S_OK.
On the Client side i call
RpcBindingSetAuthInfo(BindingHandle,(unsigned char*)pszSpn,RPC_C_AUTHN_LEVEL_CALL,
RPC_C_AUTHN_GSS_KERBEROS,NULL,
RPC_C_AUTHN_GSS_KERBEROS);
I Get "RPC Error 5 : Access Denied" from inside the client Stub-Function. This site
http://support.microsoft.com/?scid=kb%3Ben-us%3B838191&x=13&y=11
says, that the Error is incorrectly mapped and meight also be "Error 1717 : Interface Unknown". That doesnt help me either. So can anyone help me ?
I tried fetching Extended Error Information, but there doesn't seem to be any generated. When i deactivate Interface Restriction in the Group Policy Editor and leave all the Authentication
Stuff out, it works. But i don't want to go that way, it has to be possible.
|
|
|
|
|
Hi,
Maybe this might help you ...
<a href="http://www.codeguru.com/cpp/com-tech/atl/general/article.php/c11627">http:
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r
|
|
|
|
|
I'm sorry, but i couldn't find any usefull Information there. The Article was about COM+ but i use Microsoft RPC, wich is one level below. I browse the Web fpr some Sample or Tutorial now for 3 days, but it just seems, no one uses it. And Microsoft really did a crappy job on the Documentation...
|
|
|
|
|
Sorry I couldn't help but, concerning the RPC and the crappy job of the documentation ....
What do you expect, Microsoft couldn't steal it from someone.
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r
|
|
|
|
|
Why can't the derived class access protected members from its base class?
#include <iostream>
using namespace std;
class CEmployee
{
protected:
float m_HourlyRate;
float m_HoursWorked;
};
// class CEmployee //forward declaration
class CAccountant : protected CEmployee
{
public:
void CalcSalary(CEmployee &emp)
{
emp.m_HourlyRate = 50;
emp.m_HoursWorked = 1;
};
};
void main ()
{
CAccountant joe;
}
Error:
Test.cpp(17): error C2248: cannot access protected member declared in class 'CEmployee'
Also, in the code above I was trying to use a forward declaration so that I could declare CEmployee after CAccountant, but the following compilation error was displayed:
error C2504: 'CEmployee' : base class undefined
Does this mean that forward declarations cannot be done on classes that might need to be inherited?
Jon
|
|
|
|
|
jon_80 wrote: void CalcSalary(CEmployee &emp)
{
emp.m_HourlyRate = 50;
emp.m_HoursWorked = 1;
};
protected access us for derived classes only. i.e. derived class can access protected member in base class.
But externally its acts as private.
In above case m_HourlyRate and m_HoursWorked of base class can be accessed from CAccountant . But you are trying to access those member of using class instance. Which is not allowed.
jon_80 wrote: Does this mean that forward declarations cannot be done on classes that might need to be inherited?
yes.
|
|
|
|
|
I think you want a virtual method instead:
class CEmployee
{
public:
virtual void CalcSalary( void ){}
protected:
float m_HourlyRate;
float m_HoursWorked;
};
class CAccountant : protected CEmployee
{
public:
void CalcSalary( void )
{
m_HourlyRate = 50.0;
m_HoursWorked = 1.0;
};
};
"Talent without discipline is like an octopus on roller skates. There's plenty of movement, but you never know if it's going to be forward, backwards, or sideways." - H. Jackson Brown, Jr.
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
jon_80 wrote: class CAccountant : protected CEmployee
There is no reason to ever derive from a class with protected protection. Either do it as public or private (and only do it private in very few cases). See "Effective C++" for an explanation as to why.
jon_80 wrote: Also, in the code above I was trying to use a forward declaration so that I could declare CEmployee after CAccountant, but the following compilation error was displayed:
error C2504: 'CEmployee' : base class undefined
The compiler must know what the base class looks like prior to being able to parse the derived class. You can't forward declare a base class when deriving from it.
If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week
Zac
|
|
|
|
|
Hello,
how to show a character from number, mean, 65 -> A is ok!
The first 128 character are not my problem, but the others! Problem is when i try to show characters
like '›' ->&# 155, i extract the first two chars, and try with TCHAR to convert them!
Like this:
<br />
CString cstr = L"&# 155";
cstr.Delete(0,2);
TCHAR tc = _wtoi(cstr);
cstr.SetAt(0,'0');
tc = _wtoi(cstr);
How to do this right!?
P.S. i make an space between &# and 155, should be togeder
with best regards
break;
-- modified at 9:46 Friday 8th September, 2006
|
|
|
|
|
break; wrote: // browser convert this to -->"›"
Isn't ">" is 62 in equivalient number ?
One more thing _wtoi (you have written _wctoi , but is there any such api?), internally calls atol , So I thing there is not way it would return 0155.
-- modified at 8:28 Friday 8th September, 2006
|
|
|
|
|
Hello,
sorry, my mistake!
It is of course _wtoi(); !
That symbol is smaler, than the normal > character, lock > and › (this ist in html-> &# 155)?!
This is not the normal "grater than" symbol!
Type in editor with [Alt + KeyPadNum] a number 155 and the same with [Alt + KeyPad] 0155, you will see they are two
different characters!?
Windows use the ANSI character set, and the are the same with ASCII in the first 128 chars, but the rest is different, also the rest 128 characters!
To best way to understand what i mean is when you take a lock at this two charsets?
regards
pixel
|
|
|
|
|
break; wrote: Type in editor with [Alt + KeyPadNum] a number 155 and the same with [Alt + KeyPad] 0155, you will see they are two
different characters!?
Actually, I was not aware of this.
If you see implementation of atol(called thorugh _wtoi),
it extract number using this loop
char* nptr="0155";
int total=0
int c=(int)(unsigned char)*nptr++;
while (isdigit(c)) {
total = 10 * total + (c - '0');
c = (int)(unsigned char)*nptr++;
}
return total;
using _wtoi , don't think it's possible.
|
|
|
|
|
hi all i had made a dialogbox using win32 not MFC based dialog i mean wizard,and there is checkbox on that now i want to know that whether check box is checked or not
i m using this code
CButton* pCheck = (CButton*)GetDlgItem(hwnd,IDCB_CANVOTE);
int checkState = pCheck->GetCheck();
but it did not work,i had used another code.
HWND hCbox = GetDlgItem(hwnd,IDC_CHKURL);
SendMessage(hCbox, , 0, 0);
but dont know what to pass the the message so that it gives me check box selected or not.
what i want to know is that whether it is checked or unchecked
Tasleem Arif
|
|
|
|
|
See SendMessage(hwndbutton,BM_GETCHECK ,0,0);
and return value BST_CHECKED or BST_UNCHECKED if its not gray
|
|
|
|
|
Thanks it worked;)
Tasleem Arif
|
|
|
|
|
Following code will work
CButton* pCheck = (CButton*)GetDlgItem( IDCB_CANVOTE );
int checkState = pCheck->GetCheck();
|
|
|
|
|
tasleem143 wrote: ...not MFC...
How is it that you are using CButton but not using MFC?
tasleem143 wrote: but it did not work
What did not work? checkState should have been BST_CHECKED , BST_UNCHECKED , or possibly BST_INDETERMINATE if using a 3-state button.
"Talent without discipline is like an octopus on roller skates. There's plenty of movement, but you never know if it's going to be forward, backwards, or sideways." - H. Jackson Brown, Jr.
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Hi All
I'm facing the following strange thing on my code!
I discovered that in my derived classes the keyword virtual has been deleted when the base class got it.
It's incredible because I have tons of code where this occurrs!!
Do you know a way to trap this in my source code?
Does exist some tool or trick or compiler option maybe?
Thanks to all
Manu
|
|
|
|
|
What do you mean by "has been deleted" - did the editor delete it or what?
Anyway, it really doesn't matter. If a method is declared virtual in a base class it is implicitly virtual in a derived class even if it is not declared as such in the derived class. This makes sense as the entry in the vtable is already there (from the base class declaration), no need to declare it again.
But I still don't understand how it got deleted...
Cheers
Steen.
"Are you gonna check your makeup when you're done whining?" John Simmons, 05/31/2006
|
|
|
|
|
How can we enter buttons in titlebar:
|
|
|
|
|
|
|
Hi to you all,
I have a program that uses both microsoft word and outlook. I use them through automation, so I include both msword9.h and msoutl9.h. It turns out that both libraries define _Application, Panes, Selection and ApplicationEvents (and they do not seem to be identical either). I have now taken the easy route by renaming those 4 classes (to stuff like _Opplication, OSelection, etc). This does the trick, but it does not leave me with a good feeling.
Anyone have any better ideas?
Thanks in advance.
William
|
|
|
|