|
Why would you want to close an open dialog? That doesn't sound very user friendly!
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
I have subclassed an the EDIT control in my active x project.
How can I get at the base class data and methods, from within my super active x class?
its really annoying, it must be so simple!!!;P
|
|
|
|
|
hi,
i am creating a sample for testing interop.
i am having one .net(c#) class. i am going to expose this to Com Client.
i am having one MFC client program.
in that i am referring the .tlb file which is created from .net( with the Register for COM property of project is true).
it is working fine.
my problem is:
if i set that property(register for COM) to false, and i create a dll and thro' regasm/tlbexp i create a tlb.
and finaly i refer it in the MFC client program , then i will get the error "Class not registered".
could u anybody let me know what will the problem be?
|
|
|
|
|
The CLSID for .NET classes, if not explicitly set, is derived from your class's assembly version numbers (among other things). A wizard-generated project has the AssemblyVersion attribute set to 1.0.* , which instructs the compiler to generate new numbers for the last two components of the version number when you compile (the numbers are derived from the compile date and time).
Either set the Guid attribute (see GuidAttribute ), or use a fixed version number.
[EDIT] In case it wasn't clear, the consequence of the first paragraph is that the CLSID changes every time you recompile the component. [/EDIT]
Stability. What an interesting concept. -- Chris Maunder
|
|
|
|
|
Hi,
For the last few days I've been trying to create a small DLL using the IActiveDesktop interface without avail.
What I want to do is create a dll which contains a method that when passed the location of a file, sets the wallpaper to that file.
I need this to integrate with a Java application I'm writing. Just on that note, I am strictly a Java developer with some C++ experience. However! Until this week I had never opened VS.NET nor tried to perform Windows coding of any kind.
Now, I managed to create a small .exe that does this as per the COM tutorial on this site. I'd like to take this code and compile a DLL.
Alas, I'm having no end of problems. I don't know which template project I'm supposed to be using and I'm generally finding this IDE very difficult to cope with especially the linker errors! argh!
MSDN is proving a poor substitute to my beloved Javadoc and I'm at a point where I'm ready to pull my hair out from frustration.
Could someone *please* write me a small step-by-step guide as to how I should approach this?? What templates do I need to use? I tried the MFC DLL template to no avail. Maybe I'm not configuring it right? I just don't know.
|
|
|
|
|
OK. Assuming that a Java program can call into a 'flat' DLL (and that's a big assumption from what I've read), you need to do:
File > New > Project
Under Visual C++ Projects > Win32, select Win32 Project. Type a name for the project and hit OK.
In the Win32 Application Wizard dialog, select Application Settings in the left-hand bar, then select DLL under Application Type. Check the 'Export Symbols' checkbox. Hit Finish.
VS.NET generates a project containing five files: stdafx.h, stdafx.cpp, <projectname>.h, <projectname>.cpp and a readme.txt.
The stdafx files are used to produce a precompiled header. This is a binary file used by the compiler to speed up the main compilation by only reading commonly-used header files once. If you're going to use a system header, it's often handy to put the #include statement in stdafx.h.
Let's assume that you called your project NewDll. In newdll.h, VS.NET has generated an exported class, CNewDll , an exported variable, nNewDll , and a function, fnNewDll . To export a function, we want to follow the fnNewDll example; however, to make it easier to import from other languages, it's best to add extern "C" to the beginning of the declaration. This tells the compiler not to 'mangle' the function's name (produce an encoded name that includes all the type information).
If you're using the Microsoft VM for Java, that's probably enough and you need to look up J/Direct. However, the standard mechanism for including C++ code with your Java program is Java Native Interface[^]. You'll have to look up Sun's documentation for this.
Stability. What an interesting concept. -- Chris Maunder
|
|
|
|
|
When I have a lot of text in my Control (lager then 64k)
I can not handle this anymore.
CString is to small, Richedit will not take any more letters.
What can I do?
is there a alternative?
GermanGeorge
|
|
|
|
|
GermanGeorge wrote:
CString is to small,
What do you mean by this? A CString object can store up to 231-1 characters.
GermanGeorge wrote:
Richedit will not take any more letters
By chance are you sending the control a EM_LIMITTEXT message?
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
hello,
thank you for yout idea.
i used LimitText (which I thought was a limitation) and it works well right now.
GermanGeorge
|
|
|
|
|
I have a Dialog based application, which uses file type say *.chl now i want to associate all *.chl files with my dialog based application,
what changes do i have to make in registry ?
i can't even remember what my point is now, but anyway, i'm correct
Barring unforeseen acts of God and Adminstrators, my server will be up tomorrow. I'm more worried about the Adminstrators.
|
|
|
|
|
searching at google revealed this
works like a charm
-----
All you need to do is create a registry entry for your
extension containing the command to run. Have a look at
the Reg... API functions used for writing registry entries.
For example, if your extension, is ".xxx", then create a
registry entry like this:
HKEY_CLASSES_ROOT
.xxx
shell
open
command="c:\x\y\z\myapp.exe %1"
i can't even remember what my point is now, but anyway, i'm correct
Barring unforeseen acts of God and Adminstrators, my server will be up tomorrow. I'm more worried about the Adminstrators.
|
|
|
|
|
Have you looked at CWinApp::RegisterShellFileTypes() ? This is the function that is normally called to do registering. It handles all registry updates.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
I just did the same thing yesterday. But I did the registry changes in the installer, that way the entries are undone when the app is unistalled. have a look at:
http://www.jrsoftware.org/isfaq.php#assoc[^]
Sonork 100.11743 Chicken Little
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
Within you lies the power for good - Use it!
|
|
|
|
|
yup did it in installer (inno setup)
thanks
i can't even remember what my point is now, but anyway, i'm correct
Barring unforeseen acts of God and Adminstrators, my server will be up tomorrow. I'm more worried about the Adminstrators.
|
|
|
|
|
Is it possible to detect all installed codecs without using DirectShow ??
|
|
|
|
|
Would it available in WMI?
Sonork 100.41263:Anthony_Yio
Life is about experiencing ...
|
|
|
|
|
There are, I have discovered, various sorts of codec. The older sort were designed originally for Video for Windows. The newer sort actually run in kernel space and can be accessed with DirectShow. Some programs (e.g. Windows Media Player) can use both sorts. Others (e.g. Windows Media Encoder) can only use DirectShow-style codecs. A third set (e.g. VirtualDub) can only use the older VfW sort.
To enumerate VfW codecs, use ICInfo .
Note that the Windows Media codecs are DirectShow-only.
Stability. What an interesting concept. -- Chris Maunder
|
|
|
|
|
I have a BYTE array of pixels, which describes am image. Image is black - white. Pixels have 255 and 0 values. If pixels are white - this is object, black - background. I wanna know sizes and locations of all objects on image.
If i use standart recursive floodfill algorithm for every object by turns it takes too much time to scan whole image, find object, use to object floofill and to get size and location of the object.
Do anybody know fast algoritmh for simultaneously detecting of all objects on image(BYTE array)?
|
|
|
|
|
I am not sure what you mean by "sizes and locations of all objects on image", but I tried to give as many examples of floodfill types as I could in the article QuickFill.
INTP
|
|
|
|
|
Yes, I've read your article, it's really good. But QuickFill
makes floodfill only of one object. So, to fill 10 objects on the image i need to call quickfill 10 times. I wanna to fill theese 10 objects simultaneously, in 1 call. Because if
i 10 times look for object, then fill them it takes too much time.
John, i find 1 interesting thing. When i testing your programm, Opera brouser worked. And filling of one object takes 8 milliseconds. When i closing Opera, filling of 1 object takes 23 millisecondes
|
|
|
|
|
Well, filling multiple object simultaneously would require a great deal more work and would provide no speed improvement (in fact it would slow the whole process down). Although it would look great, if you actualy were seeing the objects filling.
Now this could be accomplished by using some sort of stepping where you remove the while loop in the quickfill function and have it return whether or not it is finished after each call. This would require some flag to note if it is the first time the function is called or some sort of initialization function that must be call first; in other word it would have to rember it's state. No matter how you approach the problem you are still dealing with multiple objects.
Now as for giving the illustion of them all being filled simultaneously, that should not be to difficult. You simply call quickfill 10 times but do not display the results until after all 10 are filled.
If speed becomes a problem, then modify quickfill to take a CDibData object insted so that one will not need to be created each time quickfill is called. Then copy the result back to the original bitmap, after filling it is complete. This, of cource, assumes that the objects you are refering to are graphic objects that are all located on the same bitmap.
The only advantage you have using quickfill is that you have the code to modify as you see fit. If you are developing for the desktop then the illusion of simultaneously filling can be accomplished as stated above using FloodFill.
I could do what you are attemping, by using one of the methods stated above. Just rember the key is the quickfill function, if you understand that then you can almost ignore the helper functions.
No matter how you slice it someone has to write the function to fill all those objects, and that appears to be you.
Good Luck!
P.S. As for the Opera thing I can only ass-u-me that your machine was busy doing something else.
INTP
|
|
|
|
|
Essentialy i do not need to fill objects. I need to know sizes and locations of objects in image. Image is an array of pixels (BYTE).
I need simething like this:
http://rsb.info.nih.gov/ij/docs/menus/analyze.html
But here is too compound system and its makes too much unuseless calculations. And sources are on Java, and I wanna use it in vc++.
This system find all object in one cycle, so its very quick.
P.S. no, no more processes except quickfill and opera. i think its becouse memory in windows assignes in such way.
|
|
|
|
|
Sounds more like a simple line scan algorithm of some sort is needed, something to how you would fill a polygon (only without knowing where the edges are first.
METHOD 1:
First you'll need a storage item something like the following:
struct bucket
{
int x1, x2;
struct bucket* pNext;
};
Then create an array equal to the height of the image:
bucket* pLineArray = new bucket[height];
Now start scanning at the upper left courner. When you encounter an leading edge: create a new bucket
pBucket = new bucket;
memset(pBucket,0,sizeof(bucket);
and store the location in x1 (left side of edge). Next skip over the edge, then scan until you reach the next edge. Now find the trailing edge (right side of edge) and store that in x2. Insert the bucket in the list at the current line.
void AddBucket(int nLine, bucket* pBucket)
{
bucket* pNext;
pNext = pLineArray[nLine];
if( !pNext )
pLineArray[nLine] = pNext
else {
while( pNext->pNext )
pNext = pNext->pNext;
pNext = pBucket;
}
}
Continue to scan the line adding new buckets as you go.
NOTE: The top and bottom of each object are special cases where the left and right edges are the same (Example: a single pixel at top would contain the same values for x1 and x2.
Repeat the above for each line in the image.
Now that the information stored you can write a function to analyse the information to produce a line list for each of the individual objects.
METHOD 2:
Simulare to method 1, accept that when you encounter an edge you trace all the way around the object, storing the infomation in its own line list. Then exclude that region from futhur scanning.
This method requires multiple scans and that you maintian a list of line lists.
FINALY:
Method 1 will store the information in one pass, but requires futher anasyse to produce the final information (list of line lists).
Method 2 will probably be slower, but may be easier to code.
In either method, you would have one top level function that would be called and return a list of line lists.
I do not know if my ideas help! I do hope they give you some idea of whats envoled.
Recommend reading:
"Computer Graphics: Principles and Practice in C (2nd Edition)".
"Graphics Programming" by Michael Abrash.
The Graphics Gems books, much of the code in these books are available online.
Good Luck!
INTP
|
|
|
|
|
Thanx a lot. Problem is solved.
Now problem is in Gaussing blur. It takes 120 ms for 720*575 image. We wana it takes not more than 40-50 ms. I think only assembler realisation of algorithm can improve performance.
|
|
|
|
|
The best graphics library I know of for speed is Fastgraph by Ted Gruber Software, Inc., written in hand-optimized assembly language.
The algorithm I originaly designed (in C) used assembly level routines (direct video access via hardware support) to read/write the pixel data, that is where the main bootleneck is. It was not intended to be used for image proccessing, but for simple fills like that used by the paint program that comes with Windows.
INTP
|
|
|
|