|
|
Can anybody help me out here please,
By default CRecordset Creates a RFX_Date in it's header. This Only supports CTime. How Can I save My COleDateTime to Access without converting to CTime(I don't know why CTime was ever created). I read an artical a while ago About this but I can't seem to find it again.
Hey if nobody knows, Well Somebody will know sometime!!!
|
|
|
|
|
Suppose I code such a very simple code:
void main()
{
printf("main is at 0x%p\n", main);
}
I get a result:
main is at 0x0040100F
But if I hover the cursor on the variable main while debugging, VC++ tells me, the address of main at 0x00401030.
So how can I printf the actual address of main (0x00401030) ??
Here's the assembly code:
@ILT+10(_main):
0040100F E9 1C 00 00 00 jmp main (00401030)
5: void main()
6: {
00401030 55 push ebp
00401031 8B EC mov ebp,esp
00401033 83 EC 48 sub esp,48h
00401036 53 push ebx
00401037 56 push esi
00401038 57 push edi
00401039 8D 7D B8 lea edi,[ebp-48h]
0040103C B9 12 00 00 00 mov ecx,12h
00401041 B8 CC CC CC CC mov eax,0CCCCCCCCh
00401046 F3 AB rep stos dword ptr [edi]
Maxwell Chen
People say "No news is good news". Then, no code is good code!?
|
|
|
|
|
When you run in debugger mode, some of the breakpoint code is also inserted and thus main() gets displaced.
Nish
The posting stats are now in PDF:-
http://www.busterboy.org/codeproject/
Feel free to make your comments.
Updated - May 04th, Saturday
|
|
|
|
|
Yes, but I was printing the address while in debugging mode,
it should still have printed the address that maps to the machine code, but it did not!
Please take a look at the assembly and machine code at the end of the original message again. The output told me the address of
@ILT+10(_main)
but not the address of
5: void main()<br>6: {<br>00401030 55
That's what I am curious about.
Maxwell Chen
People say "No news is good news". Then, no code is good code!?
|
|
|
|
|
In an ATL COM Server,how can I load a conventional DLL?
|
|
|
|
|
Hi,
If I understand you correct, do you want to load a DLL at runtime? If so the look at the 'LoadLibrary' API for non MFC projects and AfxLoadLibrary for MFC projects....
else if at compile time then use the static library *.lib and the required header file
|
|
|
|
|
I have an MFC Extension DLL implemented in my program. It is a simple modless dialog. Everything works fine in Debug but when I go to release and run it I get an Assertion right when I try to set a variable in the DLL class from the calling app.
I can post some code it need be, but has anyone seen this. And if so, what are some of the ways that you have fixed it.
Thanks in advance
***********************
Tony Fontenot
Recreational Solutions
tony@recsolutions.com
***********************
|
|
|
|
|
Sorry all. I figured it out. I copied the wrong dll.
***********************
Tony Fontenot
Recreational Solutions
tony@recsolutions.com
***********************
|
|
|
|
|
CString strFullName
gethostbyname(const char *name)
This won't compile under Unicode in VC 7, How should i fix this?
gethostbyname(strFullName);
Thanks
- Matt Newman / Windows XP Activist
-Sonork ID: 100.11179
01001001 00100000 01010000 01100001 01100100 00100000 01001101 01111001 00100000 01010000 01101111 01110011 01110100 00100000 01000011 01101111 01110101 01101110 01110100
|
|
|
|
|
CString only converts to LPCTSTR, which is a Unicode string when building for Unicode. The quickest way is to use an ATL conversion macro:
#include <atlconv.h>
{
USES_CONVERSION;
gethostbyname ( T2CA((LPCTSTR) strFullName) );
}
--Mike--
Buy me stuff! (Link fixed now)
Like the Google toolbar? Then check out UltraBar, with more features & customizable search engines!
My really out-of-date homepage
Big fan of Alyson Hannigan and Jamie Salé.
Sonork - 100.10414 AcidHelm
|
|
|
|
|
Michael Dunn wrote:
{
USES_CONVERSION;
gethostbyname ( T2CA((LPCTSTR) strFullName) );
}
Where do I put this?
if I replace the original with this it just makes it unreadable characters
- Matt Newman / Windows XP Activist
-Sonork ID: 100.11179
01001001 00100000 01010000 01100001 01100100 00100000 01001101 01111001 00100000 01010000 01101111 01110011 01110100 00100000 01000011 01101111 01110101 01101110 01110100
|
|
|
|
|
|
Sorry about the delay I was gone this weekend
CString strTemp;
int item = 0;
struct hostent *host;
struct in_addr *ptr;
DWORD dwScope = RESOURCE_CONTEXT;
NETRESOURCE *NetResource = NULL;
HANDLE hEnum;
WNetOpenEnum(dwScope, NULL, NULL, NULL, &hEnum);
WSADATA wsaData;
WSAStartup(MAKEWORD(1,1),&wsaData);
if (hEnum)
{
DWORD Count = 0xFFFFFFFF;
DWORD BufferSize = 2048;
LPVOID Buffer = new char[2048];
WNetEnumResource(hEnum, &Count, Buffer, &BufferSize);
NetResource = (NETRESOURCE*)Buffer;
char szHostName[200];
for (unsigned int i = 0; i < BufferSize/sizeof(NETRESOURCE); i++, NetResource++)
{
if (NetResource->dwUsage == RESOURCEUSAGE_CONTAINER && NetResource->dwType == RESOURCETYPE_ANY)
{
if (NetResource->lpRemoteName)
{
CString strFullName = NetResource->lpRemoteName;
char buf[512];
if (0 == strFullName.Left(2).Compare(_T("\\\\")))
strFullName = strFullName.Right(strFullName.GetLength()-2);
<code>host = gethostbyname(strFullName));</code>
if (!host) continue;
ptr = (struct in_addr *) host->h_addr_list[0];
sprintf(buf, "%d.%d.%d.%d", ptr->S_un.S_un_b.s_b1,
ptr->S_un.S_un_b.s_b2, ptr->S_un.S_un_b.s_b3, ptr->S_un.S_un_b.s_b4);\
List->InsertItem(item++, strFullName, 0);
List->SetItemText(item - 1, 1, (LPTSTR)buf);
List->SetItemText(item - 1, 2, NetResource->lpComment);
}
}
}
This is the original code,
- Matt Newman / Windows XP Activist
-Sonork ID: 100.11179
01001001 00100000 01010000 01100001 01100100 00100000 01001101 01111001 00100000 01010000 01101111 01110011 01110100 00100000 01000011 01101111 01110101 01101110 01110100
|
|
|
|
|
Look at the function WideCharToMultiByte to convert the UNICODE string to a char*.
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
This is basically a guess.
But you might try using WideCharToMultiByte to convert the unicode string to a normal string
Nish
The posting stats are now in PDF:-
http://www.busterboy.org/codeproject/
Feel free to make your comments.
Updated - May 04th, Saturday
|
|
|
|
|
Here you go, no please tell me how to make it work.
It does not like my CList expression (and neither do I )
<br />
typedef struct <br />
{<br />
int data;<br />
int temp;<br />
<br />
}dataStructure;<br />
<br />
typedef CList <dataStructure,dataStructure> dataList;<br />
<br />
<code><br />
<br />
p.s thanks bracket tip
|
|
|
|
|
Coremn wrote:
typedef CList <<datastructure,datastructure>> dataList;
You should change that to this:
typedef CList <dataStructure,& dataStructure> dataList;
BTW, you can add the single < or > by using & lt; and & gt;, or excapsulate all of your code in between <PRE> and </PRE> tags.
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
< broken record >
CList sucks. Use std::list instead
< /broken record >
Christian
The tragedy of cyberspace - that so much can travel so far, and yet mean so little.
And you don't spend much time with the opposite sex working day and night, unless the pizza delivery person happens to be young, cute, single and female. I can assure you, I've consumed more than a programmer's allotment of pizza, and these conditions have never aligned. - Christopher Duncan - 18/04/2002
|
|
|
|
|
Agreed
|
|
|
|
|
Hi,
suppose there are to struct type,
struct small
{
float x;
double y;
};
struct large
{
int x;
float y;
double z;
bool w;
};
and in my program I coding as this:
large b;
small *p =(small) b;
what's going on inside the code operation?
Thank you.
Best regard.
I confess that I am a stubborn guy, but why not put things thoroughly, logically and systematically clean. One concrete prolem is worth a thousand unapplied abstractions.
|
|
|
|
|
NicholasCougar wrote:
small *p =(small) b;
This won't even compile. You are attempting to assign small to small*,( via unsafe casting).
Nish
The posting stats are now in PDF:-
http://www.busterboy.org/codeproject/
Feel free to make your comments.
Updated - May 04th, Saturday
|
|
|
|
|
how do you add libs to a project in msvc? do you add the file itself to the project or include the name of said lib in the list of included libs in the project settings.
|
|
|
|
|
You can do it either way, but I prefer to do it in the project settings.
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
Sometimes (always) I'm lazy...
so I add libs via include file, here an snip from my OpenGL project:
<br />
#pragma comment(lib, "OpenGL32.lib") //link with OpenGL32 Library (VC6 Sytnax)<br />
#pragma comment(lib, "Glu32.lib") //link with Glu32 Library<br />
Hoep it helps, Moak
|
|
|
|