|
That'll probably work, but you need to make sure that the format of the text file is understandable by Excel. To verify this, export the Prolog database to a text file and try to open the file via Excel. It will ask you about the delimeters used in the file. If you can successfully open the file via Excel, then you can do the same thing with code.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
I am new to C++ (formally VB developer) and I am trying to use MFC.
I cannot figure out just how to create a simple dialog box and access a newly created text box with "Hello".
Can anyone help me with this or point me to a link that will help.
Thanks,
|
|
|
|
|
|
Hi
Am am trying to automatically open email by using C++ to drive Outlook 2003. I use #import to get the correct libraries and everything is working fine except I cannot read encrypted emails. I have an _ItemsPtr for the inbox which I can use to iterate through all the items I have received and I can read all the non-encrypted ones but I can't access the encrypted ones. When I query the IDispatch for the item to get an _MailItemPtr it says the interface is not supported.
The same code (using the appropriate libraries) works fine for Outlook 98, 2000, and 2002, just not for 2003.
Any ideas? Is there something extra I need to do for encrypted mails?
Mike
|
|
|
|
|
Hi,
I'm trying to use threads in my app and I should use static variables shared between all threads. Linking the app generates a link error: unresolved symbol static etc...
How can I avoid it?
Thanks
Vilmer
|
|
|
|
|
How are you declaring the static global variables?
Kuphryn
|
|
|
|
|
I've just declared the veriables as static, but in MyDialog class (where MyDialog is the main dialog class of my app)
|
|
|
|
|
If in the .h file for your class you have
<br />
class MyClass<br />
{<br />
static int mStatic;<br />
}
Then in the .cpp you will need the following
int MyClass::mStatic = 123;
Mike
|
|
|
|
|
One solution is to declare the global variable in stdafx.h.
Kuphryn
|
|
|
|
|
I'm using the following procedure in order to get the small icon of an
application window:
HICON GetWindowIcon
(
HWND hwnd
)
{
LRESULT lResult;
HICON hIcon;
hIcon = NULL;
lResult = SendMessageTimeout(hwnd, WM_GETICON, ICON_SMALL, 0,
SMTO_ABORTIFHUNG|SMTO_BLOCK, 1000, (DWORD_PTR *)&hIcon);
if (lResult==0) {
hIcon = NULL;
}
if (hIcon == NULL) {
hIcon = (HICON)GetClassLong(hwnd, GCL_HICONSM);
}
if (hIcon == NULL) {
hIcon = LoadIcon(NULL, IDI_APPLICATION);
}
return hIcon;
}
Sometimes, with some application, SendMessageTimeout returns a hIcon which
is different to NULL but the icon returned doesn't seem to be a small one,
although I'm using the ICON_SMALL constant. Is it normal?
I'm also using the following procedure in order to get the array of bytes
corresponding to the icon image:
int GetIconBits
(
HICON hIcon,
int iIconSize,
long* bits,
int* iIconBitsLength
)
{
ICONINFO iconInfo;
HDC dc;
BITMAPINFO bmi;
int iBits;
long maskBits[4096];
int i;
int iMask;
if(!GetIconInfo((HICON)hIcon, &iconInfo))
return -1;
if((dc = GetDC(NULL)) == NULL) {
DeleteObject(iconInfo.hbmColor);
DeleteObject(iconInfo.hbmMask);
return -1;
}
memset(&bmi, 0, sizeof(BITMAPINFO));
bmi.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
bmi.bmiHeader.biWidth = iIconSize;
bmi.bmiHeader.biHeight = -iIconSize;
bmi.bmiHeader.biPlanes = 1;
bmi.bmiHeader.biBitCount = 32;
bmi.bmiHeader.biCompression = BI_RGB;
iBits = iIconSize * iIconSize * 32 / 8;
GetDIBits(dc, iconInfo.hbmColor, 0, iIconSize, bits, &bmi,
DIB_RGB_COLORS);
GetDIBits(dc, iconInfo.hbmMask, 0, iIconSize, maskBits, &bmi,
DIB_RGB_COLORS);
for(i = 0; i < iBits; i++) {
bits[i] = bits[i] | ((maskBits[i] != 0) ? 0 : 0xff000000);
}
(*iIconBitsLength) = iBits;
ReleaseDC(NULL, dc);
DeleteObject(iconInfo.hbmColor);
DeleteObject(iconInfo.hbmMask);
return 0;
}
There is a problem with 32-bit anti-aliased icons, which are typical in
Windows XP. The images represented by the arrays of bytes returned by this
procedure have a sort of dark area around. I guess this happens because the
procedure doesn't handle correctly the mask information or something like
that, I don't know. To tell the truth the procedure isn't mine, I've copied
it. Does anybody know how I must treat the information return by the
GetDIBits calls in order get a correct array of bytes representing the
image?
Finally, which is the real format of the array of bytes returned by this
procedure? I mean, if I'm working with 32-bit icons, I need 8 bytes in order
to represent each pixel. The image is supposed to be in a RGB format so, how
are distributed the bytes? Is it something like this?
bits[0] bits[1] bits[2] bits[3] -> (0,0) pixel
bits[4] bits[5] bits[6] bits[7] -> (0,1) pixel
...
If this is correct, how are the RGB components mapped? Is it something like
this?:
A R G B
bits[0] bits[1] bits[2] bits[3] -> (0,0) pixel
bits[4] bits[5] bits[6] bits[7] -> (0,1) pixel
...
Thanks for your help.
--
|
|
|
|
|
i met the same problem as you, have you resolved it? if so, can you share your fruit with me, thank you very much
|
|
|
|
|
I have a OCX written in ATL. the OCX is used in ASP and Visual Basic. How can I debug the OCX?
|
|
|
|
|
You just need to hit a break point. Then, if your debugger is configured to give you the option, you can debug by selecting the Retry or Debug option on the exception dialog. (you may find yourself stepping through the VB6 .pdb in VS.NET, but it works ok).
I would write a little helper DLL that exports a fn that has an _asm int 3 , but it would probably be easier to import the DebugBreak statement from kernel32.dll and call it from your code.
See the Declare statement in the VB docs for info.
Declare Sub MyBreak Lib "Kernel32" Alias "DebugBreak" ()
Should work, and you can call MyBreak to cause the break exception to fire. Don't forget to use a debug build of the OCX. Once debugging, you may have to F10 your way through some kernel32 code till you get back to the VB caller - not sure.
hth
|
|
|
|
|
Just build ocx in debug mode, insert it into VB Form, build VB EXE. In VC Project Settings, point executable for debug session to that exe file. F5 to debug.
|
|
|
|
|
Could anyone help me with Schewchuks method for automatic triangualtion? I've downloaded the C version but am having dificulty running it through Microsft Visual C++. Is there a C++ version out there or a guide to using it
TIA
|
|
|
|
|
Anonymous wrote:
I've downloaded the C version but am having dificulty running it through Microsft Visual C++.
Why? What difficulties are you experiencing? Without knowing any details, it's going to be hard to offer any useful advice.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
Hello,
What did you try exactly ? I just opened a Visual Studio .Net command prompt and
typed "cl triangle.c". After uncommenting the #define NO_TIMER, it compiled for me.
Peter B.
|
|
|
|
|
I'm looking for algorithms / implementations for fast conversion between arrays of float, double and int. Array length can be up to 128K.
All I found was "a fast round()" float|double -> int, but also not optimized for arrays.
I did hope the Intel performance Libraries offer something, but I couldn't find anything.
Any takers?
we are here to help each other get through this thing, whatever it is Vonnegut jr. boost your code || Fold With Us! || sighist | doxygen
|
|
|
|
|
This site contains a good reference to the issues, but no actual solution for arrays. However it's likely that if inlining is switched on the overhead of the loop should be minimal. http://mega-nerd.com/FPcast/[^]
however you might want to look at a full assembly using SSE/SSE2 instructions to do this in parallel or to prevent the repeated fld instructions. This isn't my area of expertise but perhaps this would be a good starting point: Conversion Operations[^]
If you can keep you head when all about you
Are losing theirs and blaming it on you;
If you can dream - and not make dreams your master;
If you can think - and not make thoughts your aim;
Yours is the Earth and everything that's in it.
Rudyard Kipling
|
|
|
|
|
IoCreateDevice's third parameter is DeviceName, while IoCreateSymbolicLink's
first parameter is SymbolicLinkName. what is their full path name?
I don't known the difference between "\\Device\\DrvFltIp","\\DosDevices\\DrvFltIp" or "\\??\\DrvFltIp"
|
|
|
|
|
Not quite a full answer, but here's code I use to work with a FILE_DEVICE_UNKNOWN device that just needs simple start/open/read/close ops.
I use the following code to setup names for my device - "\\Device\\TestDriver4" is used to identify the device for the CreateService calls 'name of service' - (TestDriver4), while "\\DosDevices\\TDRV4" enables opening of the device with CreateFile as "\\.\TDRV4".
#define TDRV4_INTERNAL_NAME L"\\Device\\TestDriver4"
#define TDRV4_SYMBOLICLINK_NAME L"\\DosDevices\\TDRV4"
In my drivers TDrv4_CreateDevice0 fn, the internal name is used in IoCreateDevice, and the symbolic name (aka file name) is used in the call to IoCreateSymbolicLink.
RtlInitUnicodeString( &ustrInternalName, TDRV4_INTERNAL_NAME);
result = IoCreateDevice( pDriverObj,
sizeof(TDRV4_DEVICE_EXTENSION),
&ustrInternalName,
FILE_DEVICE_UNKNOWN,
0,
FALSE,
&pDevObj);
if(NT_SUCCESS(result)) {
pDevObj->NextDevice = NULL;
pDevObj->AttachedDevice = NULL;
pDevObj->DeviceObjectExtension->DeviceObject = pDevObj;
pDevExt = (PTDRV4_DEVICE_EXTENSION)(pDevObj->DeviceExtension);
if(NT_SUCCESS(result)) {
RtlInitUnicodeString( &ustrSymbolicLinkName, TDRV4_SYMBOLICLINK_NAME);
result = IoCreateSymbolicLink( &ustrSymbolicLinkName, &ustrInternalName);
}
yada
yada
yada
hth
|
|
|
|
|
how to add ActiveX control in a MDI application using VC7
i want to add the windows media player Component in my project to open it in a window inside my application .
|
|
|
|
|
On your menu, go to 'Tools', then 'Add/Remove Toolbox items...' Select the tab labeled 'COM Components' and find the control you're looking for in the list. It'll be added to your toolbox. It'll probably add some classes to your project also.
If I write code in my sleep, does that make me brilliant, or just a lazy programmer?
My articles
www.stillwaterexpress.com
BlackDice - the programmer formerly known as bdiamond
|
|
|
|
|
Hello,
I am working with the development of ActiveX controls in VC.NET
In my project I am using the following Classes.
1. App class (added by framework)
2. Ctrl Class (added by framework)
3. CMyclassFrameWnd class(added by me and derived from "CFrameWnd" class)
4. CMyclassView class(added by me and derived from "CView" class)
Now, I am creating a frame window in the control and connect a view created to this frame window.
coming to the matter, I want to add a mouse click event to the ActiveXcontrol.This event should fire upon clicking the View(View Class) area of the cotrol.
How can I do this?
With thanks in advance,
Jahfer,
eSoft.
|
|
|
|
|
In your ClassView pane, there should be an entry for whatever the name of your project is with 'Lib' on the end of it (something like MyControlLib). Under that node there should be a node that ends with 'Events' (something like _DMyControlEvents). Right-click on this node choose 'Add' from the popup menu, and select method. Specify the things you need for this event like any parameters. Then in your mouseclick handler, call this method before or after any default processing depending on what you want to allow the user to be able to do.
If I write code in my sleep, does that make me brilliant, or just a lazy programmer?
My articles
www.stillwaterexpress.com
BlackDice - the programmer formerly known as bdiamond
|
|
|
|
|