|
Add a #include <shellapi.h>
Steve
|
|
|
|
|
Hai Steve,
I have included the needed header files and Lib file(Shell32.lib).Actually my code is working in VC++ but the same code is not working in EVC.
Thanks For Spending Your Precious Time by Replying...
Thanks & Regards
Harshadha.
|
|
|
|
|
harshadha wrote: but the same code is not working in EVC.
Its no supported on that platform.
|
|
|
|
|
Hai,
Do you have any idea how to use that in EVC
Thanks
Harshadha
|
|
|
|
|
harshadha wrote: Do you have any idea how to use that in EVC
No.
Possibly, you can get help from mobile development[^] forum.
|
|
|
|
|
Q1:
if(action&ODA_FOCUS)
{
CBrush brush(RGB(255,0,0));
pDC->FrameRect(&rectItem,&brush);
}
I wonder why I do this in DrawItem,when I ran the program and clicked the item which is not the first one,the first item's edge turned red too?
Q2:
What is difference between ODA_FOCUS and ODA_SELECT?
Q3:
As I click an item in a listbox,and then I click another control,does combination of (state & ODS_SELECTED)&& !(action&ODA_FOCUS) correspond to the item I clicked firstly?
|
|
|
|
|
No one is interested in this problem?~~~
|
|
|
|
|
Hi all,
I have some problem in prev button in my print preview page. Actually i have a MDI and when i entered print prview page, the display is fine (Next button enabled and Prev button disabled). but when i press the next button, the prev page button is still disabled (But it is supposed to be enabled).
So could you please anyone tell me how to control this buttons display properties, such enabling and disabling.
Thank you in advance.
Regards,
Ram
|
|
|
|
|
I have an executable with an exported function like this:
__declspec(dllexport) const wchar_t * UniqueID( void );
...
const wchar_t *
UniqueID( void )
{
return( L"XYZ00001" );
}
I then do the following in another executable:
typedef const wchar_t * (*pfnID)(void);
pfnID GetUniqueID;
HMODULE hMod = LoadLibrary( L"foo.exe" );
GetUniqueID = (pfnID)GetProcAddress( hMod, "UniqueID" );
const wchar_t * id = GetUniqueID(); // Returns a valid address but data is zero
This above code fails by returning a pointer from GetUniqueID() but the data is all zero'd out.
When I rebuild foo.exe to be a dll (foo.dll) the above code works fine.
Is it possible to use LoadLibrary() to open an executable and get an exported function? The docs say it's possible but I'm wondering if the loader isn't doing proper fixup when LoadLibrary() is called on an EXE.
I notice when I step into the code the value stuffed into @eax looks like the static address of "XYZ00001" and not the fixed-up virtual address I would expect. For example, LoadLibrary returned 0x010f0000 and my function address is at 0x011b614a but the address returned from GetUniqueID() is 0x006595a0.
When I rebuild foo.exe as foo.dll I see LoadLibrary returns 0x10000000, GetProcAddress returns 0x10001000, and GetUniqueID() returns 0x101178ac. In this instance the data is correct.
Any ideas?
|
|
|
|
|
rforte wrote: I have an executable with an exported function
Is this even legal? I've never heard of it being done before.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
What do I need to specify in the program's manifest so that Vista will know that this program requires Admin privileges?
I want Vista to automatically launch a UAC prompt when the program is run.
--------------------------------
"All that is necessary for the forces of evil to win in the world is for enough good men to do nothing" -- Edmund Burke
|
|
|
|
|
See here[^] and search for "requireAdministrator"
|
|
|
|
|
That's a very useful document, thank you. But where can I find an example of the actual syntax required?
The manifest appears to be an XML document, so where exactly does the "requestedExecutionLevel" item go?
--------------------------------
"All that is necessary for the forces of evil to win in the world is for enough good men to do nothing" -- Edmund Burke
|
|
|
|
|
Nevermind! I found it further down in the document, thanks!
--------------------------------
"All that is necessary for the forces of evil to win in the world is for enough good men to do nothing" -- Edmund Burke
|
|
|
|
|
Hi,all,
I used java for a server and C(winsock) for a client. now the server
can be activated by the client's connect(...) function and then can send data to the client. the client can correctly receive the data from server and then correctly send data back(it can correctly return the bytes sent) but the server can not be activated by the data(it blocked there when it try to read data from the socket even if the client send a lot).
I spend all most one day but can not get the solution, any helps will be appreciated!
Paul
|
|
|
|
|
From your statements it seems to me the problem is on the java server side...
unless...
Even if send() returns the number of bytes "sent", that doesn't mean the bytes got received by
the other end, or even made it that far.
Is the protocol TCP?
Mark
"If you can dodge a wrench, you can dodge a ball."
|
|
|
|
|
Yes, it is TCP. if it is the problem about Java server,when I tried with Java client,then the java server is OK.
|
|
|
|
|
hmm I don't know what's different between the two (I'm not a java programmer).
I don't know what would be different besides possibly structure format and/or byte ordering in
the data sent back and forth. This should be relatively easy to debug. The data either gets there or it doesn't
Mark
"If you can dodge a wrench, you can dodge a ball."
|
|
|
|
|
Now I solved the problem. In java side, I used a "readLine()" from socket,
but in C side, I did not put a "\n" at the end of the data. that is the reason.
anyway, thanks for your analysis on the issue. now my problem is: if I use a "char*" buffer with fixed size to receive data from Java, then the original format or structure will be completely destroyed, so how to restore the data format? is there any function available to do that?
your help will be appreciated!
|
|
|
|
|
xyhan wrote: if I use a "char*" buffer with fixed size to receive data from Java, then the original format or structure will be completely destroyed
Destroyed how? If you need to keep received data then you'll need to either copy the received
bytes to another location or create separate buffers to receive bytes into.
Mark
"If you can dodge a wrench, you can dodge a ball."
|
|
|
|
|
Is there such a thing as a fixed size char* buffer in C++ (did you mean a char array??)... maybe your problem is jumping between languages, memory handling or data structure padding (the binary layout of transferred data maybe different than expected). Hard to say without more information. Code and debugging output would help, please show used data structures too.
/M
PS: Actually I ment show it to Mark S, because he will as usual answer earlier than me in socket threads
|
|
|
|
|
Hi.
I have made a dll project in VC6.
When I add #include<afx.h> the following error occurs.
I tried to remove #include<windows.h> from stdafx.h but that didn't help either.
..\vc98\mfc\include\afxv_w32.h(14) : fatal error C1189: #error : WINDOWS.H already included. MFC apps must not #include <windows.h>
|
|
|
|
|
You could try using std::string. But, I'm sure there are ways to get CString included. Why don't you work out the header it's in, and just include that ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
MohammadAmiry wrote: When I add #include<afx.h> the following error occurs.
Include afxwin.h and remove afx.h and windows.h.
|
|
|
|
|
now the following errors occur:
Compiling...
StdAfx.cpp
Compiling...
Macro2.cpp
Linking...
nafxcwd.lib(dllmodul.obj) : error LNK2005: _DllMain@12 already defined in Macro2.obj
nafxcwd.lib(dllmodul.obj) : warning LNK4006: _DllMain@12 already defined in Macro2.obj; second definition ignored
Creating library Debug/Macro2.lib and object Debug/Macro2.exp
Debug/Macro2.dll : fatal error LNK1169: one or more multiply defined symbols found
Error executing link.exe.
Creating browse info file...
Macro2.dll - 2 error(s), 1 warning(s)
|
|
|
|