1 | //
|
---|
2 | // Example illustrating problem with be_roster->Launch()
|
---|
3 | //
|
---|
4 | // Compile as C++, either gcc-2.95 or setarch x86, and invoke with
|
---|
5 | // the name of an existing text file.
|
---|
6 | //
|
---|
7 | #include <stdio.h>
|
---|
8 | #include <stdlib.h>
|
---|
9 | #include <string.h>
|
---|
10 | #include <app/Application.h>
|
---|
11 | #include <app/Roster.h>
|
---|
12 | #include <kernel/OS.h>
|
---|
13 |
|
---|
14 | extern "C" int
|
---|
15 | signatureLaunch(const char *signature, const char *file)
|
---|
16 | {
|
---|
17 | BMessage *msg = new BMessage(B_REFS_RECEIVED);
|
---|
18 | BEntry *entry = new BEntry(file);
|
---|
19 | entry_ref ref;
|
---|
20 | entry->GetRef(&ref);
|
---|
21 | msg->AddRef("refs", &ref);
|
---|
22 | return be_roster->Launch(signature, msg);
|
---|
23 | }
|
---|
24 |
|
---|
25 | int
|
---|
26 | main(int argc, char **argv)
|
---|
27 | {
|
---|
28 | signatureLaunch("text/plain", argv[1]);
|
---|
29 | return 0;
|
---|
30 | }
|
---|