|
|
Dear All,
I am unable to use the Api ::CreateFileMapping(...) in Windows7 Version and Vista for Elivated User.
Please give me solution for this. I have checked the Error using GetLastError(...) it is giving File AccessPermissions and the Error Code is 5. Please suggest an appropriate solution for this.
Thanks & Regards,
Uday.
|
|
|
|
|
Did you check the Access permissions? Is the file open in another process? Which file are you trying to map? Is it a real file, or do you use the paging backing store? If so, does the system have a backing store?
|
|
|
|
|
Hi,
It is working for Administrative User, But failed in for standard user with Administrative Privilages.
These is observed only on Windows 7 Version and Vista for 2003 and Windows XP working for standard user with administrative previlages.
Please provide me a solution for this.
Thanks,
Uday.
|
|
|
|
|
That's a different story than what you told us in the original question.
I will assume that it a real file, since you haven't answered any of the questions I asked you
Check the file permissions on disk, you will probably discover that it is limited to the administrators group.
You can either change the permissions, or run your program with elevation.
|
|
|
|
|
Hi,
I overriding the CWnd::OnSetCursor in CRicheditctrl which I use to to set my Cursor pos
via SetSel
Is there any other way to drive this notification besides a mouse movement
As it is the only way I have found of postioning my cursor
thankx
|
|
|
|
|
What exactly are you trying to do? You can position your cursor by calling SetCursorPos SetCursorPos[^]
There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition.
Blaise Pascal
|
|
|
|
|
Didn't think it worked with rich edit
|
|
|
|
|
Hello,
Below codings gives error when I use extern "C" in my dll project.
extern "C" __declspec(dllexport) void Init(); // Gives error
__declspec(dllexport) void Init(); // Can work
extern "C" __declspec(dllexport) void Init();
EXTERN_C const IID DIID__IEventFiringObjectEvents;
template <class T>
class CProxy_IEventFiringObjectEvents : public IConnectionPointImpl<T, &DIID__IEventFiringObjectEvents, CComDynamicUnkArray>
{
extern "C" __declspec(dllexport) void Init()
{
T* pT = static_cast<T*>(this);
};
};
Using extern "C" gives below error message :
error C2059: syntax error : 'string'
Please guide me on how to include extern "C".
Thanking you in advance,
Goutam
|
|
|
|
|
You cannot use extern "C" with classes and templates .
What are you trying to do?
|
|
|
|
|
extern "C" is used to make the function callable from C. Clearly a member function isn't callable from C. Your code doesn't make sense as the two concepts are not compatible.
Steve
|
|
|
|
|
Hello,
Thank you for trying to solve this problem.
I am using samples from "Understanding COM Event Handling" by Lim Bio Liong... URL below :
Understanding COM Event Handling[^]
I am trying to fire event from a ATL dll file, callable from client.
To fire event I need to use class template.
I am using extern "C" before the function name in ATL dll file, to export this function and to make it visible at client.
Below is full code :
__declspec(dllexport) void Init(SMESSAGE* sMessage);
EXTERN_C const IID DIID__IEventFiringObjectEvents;
template <class T>
class CProxy_IEventFiringObjectEvents : public IConnectionPointImpl<T, &DIID__IEventFiringObjectEvents, CComDynamicUnkArray>
{
__declspec(dllexport) void Init(SMESSAGE* sMessage)
{
CComVariant varResult;
VARIANT var;
T* pT = static_cast<T*>(this);
int nConnectionIndex;
int nConnections = m_vec.GetSize();
for (nConnectionIndex = 0; nConnectionIndex < nConnections; nConnectionIndex++)
{
pT->Lock();
CComPtr<IUnknown> sp = m_vec.GetAt(nConnectionIndex);
pT->Unlock();
IDispatch* pDispatch = reinterpret_cast<IDispatch*>(sp.p);
if (pDispatch != NULL)
{
VariantInit(&var);
VariantClear(&var);
V_VT(&var) = VT_RECORD | VT_BYREF;
V_RECORD(&var) = &sMessage;
DISPPARAMS disp = { &var, NULL, 5, 0 };
pDispatch->Invoke(0x4, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, &varResult, NULL, NULL);
}
}
}
};
Thanking you in advance,
Goutam
|
|
|
|
|
It is true, You cannot use extern "C" with classes and templates.
In the C language, the string-literal "C" is not recognized. It is used in C++ to prevent name decoration.
Remove the string-literal "C" in extern declarations, or use the following in the function declaration:
<pre>#ifdef __cplusplus
extern "C"
#endif
http://support.microsoft.com/kb/133070[^]
|
|
|
|
|
Thank you for all.
I just tested and verified that I can export function even without extern "C" from a dll.
|
|
|
|
|
hi,
how to send data to multiple clients from single server.i can send data to single clients but how to handle multiple client. can any one provide code for that part.
sravanthi
|
|
|
|
|
In main thread you listen for client connections. Once you got a client connection, you can create a corresponding socket and thread.Then all the communication can be handled in that thread using that socket.
Of course, if there are too many client to deal with, this is not a good way. You can use iocp instead.
|
|
|
|
|
i am using data gram socket where listen and accept will not be used.
i want just to handle three to four clients. can u please provide that part of code.
|
|
|
|
|
|
i go with this simple structure
typedef struct sturctEGO {<br />
int ID;<br />
int Superego; <br />
int Ego = Superego - ID; <br />
} Me;
Am i right ?
the theory http://en.wikipedia.org/wiki/Id,_ego,_and_super-ego
|
|
|
|
|
Had you actually tried to compile this before asking the question you would have noticed that the line
int Ego = Superego - ID;
produces a number of errors, as it is an invalid expression. Other than that your structure may or may not have some use.
It's time for a new signature.
|
|
|
|
|
Craps: you're an idiot!
You're simply wrong.
Well, it is pretty good, but you probably can do better.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
It's not for any use...only to help informatics students understand better the structure model of Sigmund Freud the ones that listen psychology class in high school
|
|
|
|
|
phicho wrote: to help informatics students understand better the structure model of Sigmund Freud
I don't think it will help anyone to understand anything.
It's time for a new signature.
|
|
|
|
|
You should have posted this in the Lounge.
There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition.
Blaise Pascal
|
|
|
|
|
Hi,
Is there a way to know if a window is completely Obscured i.e the window is "not visible" to the user but it is behind another larger application window.
I am trying to do or not do something if the window is completely hidden from the user but not made invisible.
Thanks in advance.
|
|
|
|