|
The order you see is dependant upon the underlying file system. For NTFS, you will generally see the files in alphabetical order by name. For FAT32, it's in 'directory' order, which is generally the order in which the files were added to the directory.
bugDanny wrote:
Is the finder possibly interfering with opening the file?
Doubtful. Try debugging your examine.open function with a hand-entered, known good file path.
Software Zen: delete this;
|
|
|
|
|
Dear Community,
I have a question about integration of context sensitiv help for dialogs in a vc++ developed application. I use a window with several tabs and like to provide help for the tabdialogs. Every tab obtained a contextid and the contextid is compiled into the chm-helpfile. I display the contextid of the called tabdialog after pressing F1 in a message window.
Only the first tab starts the help and displayes the context id, when I hit F1 oder use the "What is" function. The helpfilecall of all other tabs, if they are active, dos not work and no contextid is displayed. Can anyone tell me what's the reason for?
Thanks in advance for help.
Heyerdahl
|
|
|
|
|
I'm writing a C++ DLL to speed up (run time over 1 hour) an excel macro. I read arrays in the macro, pass them to the DLL as SAFEARRAYs, identify the memory location, assign it to a new C++ array. I read some of the arrays and write to others. Then the excel macro reads the arrays and writes the results to a spreadsheet.
An early version of the program ran OK (50,000 loops through the arrays) -- after some early problems -- and the results were correct (I verified them manually in excel). The run time was reduced by a factor of over 10 !!!.
Then I expanded the program and now it freezes up -- never at the same place but always on the same type of command and always a memory access violation, either assigning the pointer to the C++ array or reading from/writing to the array.
The code looks like this:
In excel macro:
Code:
Option Explicit
Option Base 0
Public CF() As Double, IssuerCorrel() As Double, CRN() As Double, TransitionIndex() As Integer, TransCutoff(0 To 6, 0 To 7) As Double, IssuerEndRatingCode() As Integer
Declare Sub Cholesky Lib “C:\CreditRisk\CreditSim.dll” (IssuerCorrel() As Double, CF() As Double, ByVal IssuerCount As Integer)
Sub ScenarioGenerator()
Application.Calculation = xlCalculationManual: Application.ScreenUpdating = False: Application.EnableEvents = False
Dim IssuerCount As Integer,
Read in some data from spreadsheets
Dim IssuerCorrel(IssuerCount, IssuerCount) as Single; CF(IssuerCount, IssuerCount) as Single
Read more data from spreadsheets
Call Cholesky(IssuerCorrel(), CF(), ByVal IssuerCount)
Write some output data to spreadsheets
End Sub
In C++:
Code:
#include "stdafx.h"
#include <windows.h>
#include <oleauto.h>
#include "CreditSim.h"
#include "Oaidl.h"
#include <stdlib.h>
#include <math.h>
#include <time.h>
BOOL APIENTRY DllMain( HANDLE hModule,
DWORD ul_reason_for_call,
LPVOID lpReserved
)
{
return TRUE;
}
void __declspec (dllexport) __stdcall Cholesky(
SAFEARRAY **IssuerCorrel, SAFEARRAY **CF, short IssuerCount)
{
double L = 0.999999;
short n = IssuerCount;
long i = 0;long j = 0; long k = 0;
srand( (unsigned) time( NULL ) );
HRESULT SafeArrayLock( SAFEARRAY **IssuerCorrel );
HRESULT SafeArrayLock( SAFEARRAY **CF );
// Create new arrays that point to the Safearray data locations
double* CFc;
CFc = (double*)(*CF)->pvData;
CFc[0]= *CFc; Program fails here.
double* IssuerCorrelc;
IssuerCorrelc = (double*)(*IssuerCorrel)->pvData;
IssuerCorrelc [0] =*IssuerCorrelc; Program fails here.
CFc[n*(n-1)+n-1] = IssuerCorrelc[n*(n-1)+n-1];
for (j = n-2; j>=0; j--)
{
CFc[n*j + j] = IssuerCorrelc[n*j + j];
for (k = n-1; k>j; k--)
{
CFc[n*j + k] = IssuerCorrelc[n*j + k] * L;
for (i = k + 1; i
|
|
|
|
|
When you call function Cholesky you should have at more than zero element in the array IssuerCorrel and CF. Try to check that before calling because when array is 0 you have failure.
|
|
|
|
|
Hi there,
I am creating Edit Box at runtime with CEdit class
and I have to pass there Edit Box Styles
but it is displying the Edit Box with flat property
can anybody tell me how we can creat 3D look like Edit Box
Bye
Regards
IndianOcean
|
|
|
|
|
WS_EX_CLIENTEDGE
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" - mYkel - 21 Jun '04
"There's not enough blatant self-congratulatory backslapping in the world today..." - HumblePie - 21 Jun '05
Within you lies the power for good - Use it!
|
|
|
|
|
I have already used this property but
it did not come in to required look.
do u have any other preoperty for 3D look?
Thanks & Regards
Indian Ocean
|
|
|
|
|
WS_EX_CLIENTEDGE is the one for 3D look. Are you sure that it is not being removed somehow?
Run Spy++ and use the window finder to select the control, then look under the Styles tab - extended styles list to see if WS_EX_CLIENTEDGE is listed.
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" - mYkel - 21 Jun '04
"There's not enough blatant self-congratulatory backslapping in the world today..." - HumblePie - 21 Jun '05
Within you lies the power for good - Use it!
|
|
|
|
|
I have checked the styles
From Spy and u are right it is not listed in the styles..
Some how it is being removed or like that
i m using these properties
WS_CHILD | WS_BORDER | WS_VISIBLE | ES_LEFT |WS_EX_CLIENTEDGE ,
if can tell me something.........
thanks & regards
Indian Ocean
|
|
|
|
|
WS_EX_CLIENTEDGE is an extended style, not a regular style, so it can not be used with the other styles you listed.
Use the CreateEx function to create your edit control
MyEdit.CreateEx(WS_EX_CLIENTEDGE,
_T("EDIT"),
NULL,
WS_CHILD | WS_BORDER | WS_VISIBLE | ES_LEFT,
&Rect,
pParentWnd,
nID,
NULL);
See CWnd::CreateEx in MSDN for more info.
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" - mYkel - 21 Jun '04
"There's not enough blatant self-congratulatory backslapping in the world today..." - HumblePie - 21 Jun '05
Within you lies the power for good - Use it!
|
|
|
|
|
hello friends i need to develop a vc++ program which can add new item in menu of excel and can open a form to insert text in selected cells
|
|
|
|
|
Ok, so what exactly do you need help with? Have you looked at MSDN article Q178749 to see how to use Excel automation?
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
hello friends i need to develop a vc++ program which can add new item in menu of excel and can oen a form to insert text in selected cells
|
|
|
|
|
Hello Friends
How can a MFC application determine if it was invoked in response to one of its registered file being double clicked?
regards,
Kuldeep
|
|
|
|
|
You can check the command line that was passed to the application.
If you vote me down, my score will only get lower
|
|
|
|
|
KSMANN wrote:
How can a MFC application determine if it was invoked in response to one of its registered file being double clicked?
In continaution With Mr. Roger, you have use to GetCommandLine() Api to reterive commandline.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
Hi,
I'm quiet arrived...
I know how to load a Dll with LoadLibrary, and how to get a pointer function with GetProcAddress. And this, between Borland C++ Builder and Visual C++.
I know, with Borland only, how to return a class's pointer in an extern function (the pointer of the fonction is obtained by GetProcAddress). Then, I can call the class methods in the Dll loaded by loadlibrary.
But in visual, for the moment, i don't arrive to do the same ...
Thanks if you've a sample for instance !
|
|
|
|
|
You could use the same principle as COM works: you have a function that will instantiate the object for you:
void GetObject(YourClass* & pInstance);
Your pointer is passed by reference that means the function won't make a copy of it so if you make a new, you will get the new adress in your program. Inside that function, you can then create your class (with new).
One really important thing is that you have to be carefull with memorory deletion: you cannot delete this object in your program !! It has to be freed in the DLL itselfs ('cause it has been allocated in the DLL memory). The best way to delete the object is to add a function for doing that:
void YourClass::Destroy()<br />
{<br />
delete this;<br />
}
Hope this helps
|
|
|
|
|
Thanks ! But I have one more problem (easyer for you ..) How tell (declare in a header ".h") to the linker that the reference of pInstance->MyMethod isn't to resolved in a ".lib" ??? - Damned visual I'm new in visual C++ lol -
Thanks again,
|
|
|
|
|
From what I know, you cannot. The compiler needs to know if the function you are calling is included in the file.
One solution to overcome the problem of including both the *.h and the *.cpp files in your project is to use an interface for your class: you just make your class inherits from a pure abstract class (a class that has no member variables and whose functions needs to be redefined in the child class). Something like:
class MyInterface<br />
{<br />
<br />
void Method1() = 0;<br />
void Method2() = 0;<br />
....<br />
}
And in a separate file, you define your class that inherits of MyInterface:
class MyClass : public MyInterface<br />
{<br />
void Method1();<br />
void Method2();<br />
}
And the functions arre defined in the cpp file of the class.
So like that you only need to provide the .h file of the interface to your program and your program will only use a pointer to the interface. But inside the dll, when you create the pointer, you create in fact the child class.
Hope this helps
|
|
|
|
|
There is a function that checks for white space in a string called
isspace(int nTest)
Is there a similiar type function that looks for a "\n"?
I am trying to insert a \r before every instance of \n in an std::string
|
|
|
|
|
isspace tests for spaces (' ' ), tabs ('\t' ) and new lines ('\n' )...
why not using std::string::replace("\n", "\r\n") ?
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
That sounds like what i need. Was not aware of that.
What would the syntax look like for this?
I have
std::string Response;
//Response has large amount of text with many "\n"'s
Response.replace ("\n","\r\n"); i get an error 2661 on this line
//The above line should parse throuh and replace all occurrances of \n with \r\n right.
|
|
|
|
|
|
Hello,
I am developing an application where I need to load custom data to Analysis Server (MS-OLAP) without going through any OLE DB Provider.
I am able to load data into dimensions/cubes using Microsoft OLE DB provider for ODBC Drivers. But my requirement is loading data at runtime from a buffer. Is there any way to do this? Are there any APIs which can help me to load this data directly?
Thanks & regards,
kuldeep kumar
|
|
|
|